Add event listener to close dialog.

This commit is contained in:
trading_peter 2022-04-26 14:04:01 +02:00
parent d4038bbe37
commit 5a69cc65e6
2 changed files with 3 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@tp/tp-dialog", "name": "@tp/tp-dialog",
"version": "1.0.3", "version": "1.0.4",
"description": "", "description": "",
"main": "tp-dialog.js", "main": "tp-dialog.js",
"scripts": { "scripts": {

View File

@ -81,11 +81,13 @@ class TpDialog extends EventHelpers(LitElement) {
connectedCallback() { connectedCallback() {
super.connectedCallback(); super.connectedCallback();
this.listen(this, 'click', '_onDialogClick'); this.listen(this, 'click', '_onDialogClick');
this.listen(this, 'dialog-close', 'close');
} }
disconnectedCallback() { disconnectedCallback() {
super.disconnectedCallback(); super.disconnectedCallback();
this.unlisten(this, 'click', '_onDialogClick'); this.unlisten(this, 'click', '_onDialogClick');
this.unlisten(this, 'dialog-close', 'close');
} }
show() { show() {