aboutsummaryrefslogtreecommitdiff
path: root/static/globals.ts
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2021-11-15 00:43:49 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2021-11-15 00:43:49 +0100
commit7b604002e5dd73f933ef89b37e60ab07d347c44d (patch)
tree76a4a19d718df5b98c97ec36abd898d2b2e60716 /static/globals.ts
parentMade VIEW and EDIT_MODE correctly global. (diff)
downloadcalp-7b604002e5dd73f933ef89b37e60ab07d347c44d.tar.gz
calp-7b604002e5dd73f933ef89b37e60ab07d347c44d.tar.xz
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.
Diffstat (limited to 'static/globals.ts')
-rw-r--r--static/globals.ts5
1 files changed, 3 insertions, 2 deletions
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<uid, VEvent> = new Map;
const event_calendar_mapping: Map<uid, string> = 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';