Skip to content

Commit 8f6bc55

Browse files
authored
Merge pull request #89 from CaliStyle/7.x.x-alpha
[fix] #87 #51
2 parents 8bd99e8 + bd47ac0 commit 8f6bc55

File tree

8 files changed

+35
-5
lines changed

8 files changed

+35
-5
lines changed

ng-package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "./node_modules/ng-packagr/ng-package.schema.json",
33
"name": "ng-intercom",
4-
"version": "7.0.1-beta.1",
4+
"version": "7.0.1-beta.2",
55
"licensePath": "LICENSE",
66
"lib": {
77
"entryFile": "public_api.ts",

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ng-intercom",
3-
"version": "7.0.1-beta.1",
3+
"version": "7.0.1-beta.2",
44
"license": "MIT",
55
"repository": {
66
"type": "git",

src/app/ng-intercom/intercom/intercom.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export class Intercom {
5656
* when the page loads. You call this method with the standard intercomSettings object.
5757
*/
5858
public boot(intercomData?: BootInput): void {
59+
console.log('brk', intercomData)
5960
if (!isPlatformBrowser(this.platformId)) {
6061
return
6162
}
@@ -241,6 +242,10 @@ export class Intercom {
241242
return
242243
}
243244

245+
// Set the window configuration to conf
246+
(<any>window).intercomSettings = conf
247+
248+
// Create the intercom script in document
244249
const s = this.document.createElement('script')
245250
s.type = 'text/javascript'
246251
s.async = true
@@ -267,6 +272,10 @@ export class Intercom {
267272
this.id = config.appId
268273
const w = <any>window
269274
const ic = w.Intercom
275+
276+
// Set window config for Intercom
277+
w.intercomSettings = config
278+
270279
if (typeof ic === 'function') {
271280
ic('reattach_activator')
272281
ic('update', config)

src/app/ng-intercom/shared/intercom-config.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,22 @@ import { Injectable } from '@angular/core'
44
export class IntercomConfig {
55
appId: string
66
updateOnRouterChange?: boolean
7+
/**
8+
* Customize left or right position of messenger
9+
*/
710
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
825
}

src/app/root/app.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export class AppComponent implements OnInit {
3131
this.intercom.boot({
3232
app_id: 'klwzj86j',
3333
// Supports all optional configuration.
34+
alignment: 'right',
3435
widget: {
3536
'activator': '#intercom'
3637
}
@@ -41,6 +42,7 @@ export class AppComponent implements OnInit {
4142
setTimeout(() => this.intercom.boot({
4243
app_id: 'klwzj86j',
4344
// Supports all optional configuration.
45+
alignment: 'left',
4446
widget: {
4547
'activator': '#intercom'
4648
}

src/app/root/app.module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ import { IntercomModule } from '../ng-intercom/intercom.module'
3636
SharedModule,
3737
IntercomModule.forRoot({
3838
appId: 'klwzj86j',
39-
updateOnRouterChange: true
39+
updateOnRouterChange: true,
40+
alignment: 'left'
4041
}),
4142
environment.production ? ServiceWorkerModule.register('/ngsw-worker.js') : []
4243
],

src/app/root/app.server.module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ import { IntercomModule } from '../ng-intercom/intercom.module'
2828
SharedModule,
2929
IntercomModule.forRoot({
3030
appId: 'klwzj86j',
31-
updateOnRouterChange: true
31+
updateOnRouterChange: true,
32+
alignment: 'left'
3233
})
3334
],
3435
providers: [],

0 commit comments

Comments
 (0)