File tree Expand file tree Collapse file tree 8 files changed +35
-5
lines changed Expand file tree Collapse file tree 8 files changed +35
-5
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"$schema" : " ./node_modules/ng-packagr/ng-package.schema.json" ,
3
3
"name" : " ng-intercom" ,
4
- "version" : " 7.0.1-beta.1 " ,
4
+ "version" : " 7.0.1-beta.2 " ,
5
5
"licensePath" : " LICENSE" ,
6
6
"lib" : {
7
7
"entryFile" : " public_api.ts" ,
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " ng-intercom" ,
3
- "version" : " 7.0.1-beta.1 " ,
3
+ "version" : " 7.0.1-beta.2 " ,
4
4
"license" : " MIT" ,
5
5
"repository" : {
6
6
"type" : " git" ,
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ export class Intercom {
56
56
* when the page loads. You call this method with the standard intercomSettings object.
57
57
*/
58
58
public boot ( intercomData ?: BootInput ) : void {
59
+ console . log ( 'brk' , intercomData )
59
60
if ( ! isPlatformBrowser ( this . platformId ) ) {
60
61
return
61
62
}
@@ -241,6 +242,10 @@ export class Intercom {
241
242
return
242
243
}
243
244
245
+ // Set the window configuration to conf
246
+ ( < any > window ) . intercomSettings = conf
247
+
248
+ // Create the intercom script in document
244
249
const s = this . document . createElement ( 'script' )
245
250
s . type = 'text/javascript'
246
251
s . async = true
@@ -267,6 +272,10 @@ export class Intercom {
267
272
this . id = config . appId
268
273
const w = < any > window
269
274
const ic = w . Intercom
275
+
276
+ // Set window config for Intercom
277
+ w . intercomSettings = config
278
+
270
279
if ( typeof ic === 'function' ) {
271
280
ic ( 'reattach_activator' )
272
281
ic ( 'update' , config )
Original file line number Diff line number Diff line change @@ -4,5 +4,22 @@ import { Injectable } from '@angular/core'
4
4
export class IntercomConfig {
5
5
appId : string
6
6
updateOnRouterChange ?: boolean
7
+ /**
8
+ * Customize left or right position of messenger
9
+ */
7
10
alignment ?: 'left' | 'right'
11
+ /**
12
+ * Customize horizontal padding
13
+ */
14
+ horizontal_padding ?: number
15
+
16
+ /**
17
+ * Customize vertical padding
18
+ */
19
+ vertical_padding ?: number
20
+
21
+ /**
22
+ * arbitrarily localize your intercom messenger
23
+ */
24
+ language_override ?: string
8
25
}
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ export class AppComponent implements OnInit {
31
31
this . intercom . boot ( {
32
32
app_id : 'klwzj86j' ,
33
33
// Supports all optional configuration.
34
+ alignment : 'right' ,
34
35
widget : {
35
36
'activator' : '#intercom'
36
37
}
@@ -41,6 +42,7 @@ export class AppComponent implements OnInit {
41
42
setTimeout ( ( ) => this . intercom . boot ( {
42
43
app_id : 'klwzj86j' ,
43
44
// Supports all optional configuration.
45
+ alignment : 'left' ,
44
46
widget : {
45
47
'activator' : '#intercom'
46
48
}
Original file line number Diff line number Diff line change @@ -36,7 +36,8 @@ import { IntercomModule } from '../ng-intercom/intercom.module'
36
36
SharedModule ,
37
37
IntercomModule . forRoot ( {
38
38
appId : 'klwzj86j' ,
39
- updateOnRouterChange : true
39
+ updateOnRouterChange : true ,
40
+ alignment : 'left'
40
41
} ) ,
41
42
environment . production ? ServiceWorkerModule . register ( '/ngsw-worker.js' ) : [ ]
42
43
] ,
Original file line number Diff line number Diff line change @@ -28,7 +28,8 @@ import { IntercomModule } from '../ng-intercom/intercom.module'
28
28
SharedModule ,
29
29
IntercomModule . forRoot ( {
30
30
appId : 'klwzj86j' ,
31
- updateOnRouterChange : true
31
+ updateOnRouterChange : true ,
32
+ alignment : 'left'
32
33
} )
33
34
] ,
34
35
providers : [ ] ,
You can’t perform that action at this time.
0 commit comments