|
|
@ -108,25 +108,6 @@ export class ModalComponent implements OnDestroy {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
listen() {
|
|
|
|
listen() {
|
|
|
|
fromEvent(document, 'click')
|
|
|
|
|
|
|
|
.pipe(
|
|
|
|
|
|
|
|
debounceTime(100),
|
|
|
|
|
|
|
|
takeUntil(this.destroy$),
|
|
|
|
|
|
|
|
filter((event: MouseEvent) => {
|
|
|
|
|
|
|
|
const isOpenConfirmation = this.isOpenConfirmation || document.querySelector('p-toastitem');
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
event &&
|
|
|
|
|
|
|
|
this.closable &&
|
|
|
|
|
|
|
|
this.modalContent &&
|
|
|
|
|
|
|
|
!isOpenConfirmation &&
|
|
|
|
|
|
|
|
!this.modalContent.nativeElement.contains(event.target)
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
.subscribe(_ => {
|
|
|
|
|
|
|
|
this.close();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fromEvent(document, 'keyup')
|
|
|
|
fromEvent(document, 'keyup')
|
|
|
|
.pipe(
|
|
|
|
.pipe(
|
|
|
|
takeUntil(this.destroy$),
|
|
|
|
takeUntil(this.destroy$),
|
|
|
@ -175,6 +156,10 @@ export class ModalComponent implements OnDestroy {
|
|
|
|
this.visible = false;
|
|
|
|
this.visible = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onClickBackdrop() {
|
|
|
|
|
|
|
|
this.close();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function getFlatNodes(nodes: NodeList): HTMLElement[] {
|
|
|
|
function getFlatNodes(nodes: NodeList): HTMLElement[] {
|
|
|
|