1
0
mirror of https://github.com/bitwarden/desktop synced 2026-01-08 03:23:14 +00:00

set generated password from add/edit

This commit is contained in:
Kyle Spearrin
2018-01-29 16:33:38 -05:00
parent ce84e8e428
commit 40c5cfa10b
5 changed files with 30 additions and 2 deletions

View File

@@ -4,7 +4,6 @@ import {
Component,
ComponentFactoryResolver,
EventEmitter,
Input,
OnDestroy,
Output,
Type,
@@ -17,6 +16,10 @@ import {
template: `<ng-template #container></ng-template>`,
})
export class ModalComponent implements OnDestroy {
@Output() onClose = new EventEmitter();
@Output() onClosed = new EventEmitter();
@Output() onShow = new EventEmitter();
@Output() onShown = new EventEmitter();
@ViewChild('container', { read: ViewContainerRef }) container: ViewContainerRef;
parentContainer: ViewContainerRef = null;
fade: boolean = true;
@@ -29,6 +32,7 @@ export class ModalComponent implements OnDestroy {
}
show<T>(type: Type<T>, parentContainer: ViewContainerRef, fade: boolean = true): T {
this.onShow.emit();
this.parentContainer = parentContainer;
this.fade = fade;
@@ -50,10 +54,13 @@ export class ModalComponent implements OnDestroy {
});
}
this.onShown.emit();
return componentRef.instance;
}
close() {
this.onClose.emit();
this.onClosed.emit();
if (this.parentContainer != null) {
this.parentContainer.clear();
}