From b45c79d65b8f19bb5b9f4db0fa527235fcdaf069 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 2 Apr 2019 09:29:20 -0400 Subject: [PATCH] send modal state messages --- jslib | 2 +- src/app/modal.component.ts | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/jslib b/jslib index 2ef1b7d65c..c63ff4485e 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 2ef1b7d65c02f7f204a0bb5a46c28aa093be274d +Subproject commit c63ff4485eb8a0ff5b4e5c8ef3c851f4ca056646 diff --git a/src/app/modal.component.ts b/src/app/modal.component.ts index 819612c551..478f22792a 100644 --- a/src/app/modal.component.ts +++ b/src/app/modal.component.ts @@ -10,6 +10,8 @@ import { import { ModalComponent as BaseModalComponent } from 'jslib/angular/components/modal.component'; import { Utils } from 'jslib/misc/utils'; +import { MessagingService } from 'jslib/abstractions/messaging.service'; + @Component({ selector: 'app-modal', template: ``, @@ -17,8 +19,8 @@ import { Utils } from 'jslib/misc/utils'; export class ModalComponent extends BaseModalComponent { el: any = null; - constructor(componentFactoryResolver: ComponentFactoryResolver) { - super(componentFactoryResolver); + constructor(componentFactoryResolver: ComponentFactoryResolver, messagingService: MessagingService) { + super(componentFactoryResolver, messagingService); } ngOnDestroy() { /* Nothing */ } @@ -37,18 +39,22 @@ export class ModalComponent extends BaseModalComponent { this.el.on('show.bs.modal', () => { this.onShow.emit(); + this.messagingService.send('modalShow'); }); this.el.on('shown.bs.modal', () => { this.onShown.emit(); + this.messagingService.send('modalShown'); if (!Utils.isMobileBrowser) { this.el.find('*[appAutoFocus]').focus(); } }); this.el.on('hide.bs.modal', () => { this.onClose.emit(); + this.messagingService.send('modalClose'); }); this.el.on('hidden.bs.modal', () => { this.onClosed.emit(); + this.messagingService.send('modalClosed'); if (this.parentContainer != null) { this.parentContainer.clear(); }