From 7b604002e5dd73f933ef89b37e60ab07d347c44d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 15 Nov 2021 00:43:49 +0100 Subject: Reword popup visible attribute. Now all logic for handling hiding and showing popups are inside the PopupElement class, making it much harder to do stuff incorrectly. It also slowly releases the knot around popup.ts. --- static/globals.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'static/globals.ts') diff --git a/static/globals.ts b/static/globals.ts index b0871aa2..7ccfb3d2 100644 --- a/static/globals.ts +++ b/static/globals.ts @@ -5,6 +5,7 @@ export { import { VEvent } from './vevent' import { uid } from './types' +import { ComponentBlock } from './components/vevent-block' const vcal_objects: Map = new Map; const event_calendar_mapping: Map = new Map; @@ -18,14 +19,14 @@ declare global { } window.vcal_objects = vcal_objects; -function find_block(uid: uid): HTMLElement | null { +function find_block(uid: uid): ComponentBlock | null { let obj = vcal_objects.get(uid) if (obj === undefined) { return null; } for (let el of obj.registered) { if (el.tagName === 'vevent-block') { - return el; + return el as ComponentBlock; } } // throw 'Popup not fonud'; -- cgit v1.2.3