From 5a69cc65e62cf0055e8ff23c57a6a54ee3469557 Mon Sep 17 00:00:00 2001 From: trading_peter Date: Tue, 26 Apr 2022 14:04:01 +0200 Subject: [PATCH] Add event listener to close dialog. --- package.json | 2 +- tp-dialog.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index a904458..637e00d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tp/tp-dialog", - "version": "1.0.3", + "version": "1.0.4", "description": "", "main": "tp-dialog.js", "scripts": { diff --git a/tp-dialog.js b/tp-dialog.js index bbd3e1c..6017e92 100644 --- a/tp-dialog.js +++ b/tp-dialog.js @@ -81,11 +81,13 @@ class TpDialog extends EventHelpers(LitElement) { connectedCallback() { super.connectedCallback(); this.listen(this, 'click', '_onDialogClick'); + this.listen(this, 'dialog-close', 'close'); } disconnectedCallback() { super.disconnectedCallback(); this.unlisten(this, 'click', '_onDialogClick'); + this.unlisten(this, 'dialog-close', 'close'); } show() {