From 568ca6a042b3246f0d22d3d9d7c504d7e4c73e68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 1 Aug 2022 20:28:00 +0200 Subject: Minor cleanup in TS files. --- static/components/popup-element.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'static/components/popup-element.ts') diff --git a/static/components/popup-element.ts b/static/components/popup-element.ts index 3300f885..458f543c 100644 --- a/static/components/popup-element.ts +++ b/static/components/popup-element.ts @@ -71,10 +71,12 @@ class PopupElement extends ComponentVEvent { return ['visible']; } - attributeChangedCallback(name: string, oldValue?: string, newValue?: string) { + attributeChangedCallback(name: string, _?: string, newValue?: string) { switch (name) { case 'visible': - this.onVisibilityChange() + if (newValue !== null) + /* Only run resize code when showing the popup */ + this.onVisibilityChange() break; } } @@ -92,6 +94,7 @@ class PopupElement extends ComponentVEvent { } private onVisibilityChange() { + console.log('here'); /* TODO better way to find root */ let root; -- cgit v1.2.3