From 59142408387ab43d61e3773489f3ac1073a0afaf Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 29 Jan 2018 12:14:19 -0500 Subject: [PATCH] modal adjustments --- src/app/modal.component.ts | 11 ++ .../vault/password-generator.component.html | 150 +----------------- src/scss/base.scss | 6 +- src/scss/buttons.scss | 35 ++++ src/scss/modal.scss | 63 ++++++-- src/scss/styles.scss | 1 + src/scss/vault.scss | 31 ---- 7 files changed, 105 insertions(+), 192 deletions(-) create mode 100644 src/scss/buttons.scss diff --git a/src/app/modal.component.ts b/src/app/modal.component.ts index 00ad833f71..7e00c63be9 100644 --- a/src/app/modal.component.ts +++ b/src/app/modal.component.ts @@ -39,6 +39,17 @@ export class ModalComponent implements OnDestroy { const factory = this.componentFactoryResolver.resolveComponentFactory(type); const componentRef = this.container.createComponent(factory); + + document.querySelector('.modal-dialog').addEventListener('click', (e: Event) => { + e.stopPropagation(); + }); + + for (const closeElement of document.querySelectorAll('.modal, .modal *[data-dismiss="modal"]')) { + closeElement.addEventListener('click', (event) => { + this.close(); + }); + } + return componentRef.instance; } diff --git a/src/app/vault/password-generator.component.html b/src/app/vault/password-generator.component.html index 7fcf23a133..2450c4b799 100644 --- a/src/app/vault/password-generator.component.html +++ b/src/app/vault/password-generator.component.html @@ -1,149 +1,15 @@