diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-12-10 00:16:25 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-12-10 00:48:09 +0100 |
commit | de593cf0d4a6a082f0c42e00be395e0f6cf49e96 (patch) | |
tree | 578e4d10aabc3bfac98d9962ea4644b357fbb044 /static/components/vevent-block.ts | |
parent | Remove vcal.js. (diff) | |
download | calp-de593cf0d4a6a082f0c42e00be395e0f6cf49e96.tar.gz calp-de593cf0d4a6a082f0c42e00be395e0f6cf49e96.tar.xz |
Remove popup.ts, migrating all functionality elsewhere.
The simple procedures
- close_popup
- open_popup
- toggle_popup
- find_popup
Were mostly here for legacy.
The procedures
- popup_from_event
- event_from_popup
where holdovers from the old way of finding popups, and should be done
through the VEvent objects now.
close_all_popups was used only once, so the code was moved inline.
Finally, moving the last hovered over popup to the top, along with tab
switch keybings were restored, and moved to propper places.
Diffstat (limited to 'static/components/vevent-block.ts')
-rw-r--r-- | static/components/vevent-block.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/static/components/vevent-block.ts b/static/components/vevent-block.ts index 0aad19b2..6b3e7dec 100644 --- a/static/components/vevent-block.ts +++ b/static/components/vevent-block.ts @@ -2,7 +2,6 @@ export { ComponentBlock } import { ComponentVEvent } from './vevent' import { VEvent } from '../vevent' -import { toggle_popup, find_popup } from '../popup' import { parseDate, to_local } from '../lib' @@ -16,9 +15,11 @@ class ComponentBlock extends ComponentVEvent { this.addEventListener('click', () => { let uid = this.uid - let popup = find_popup(uid); + /* TODO is it better to find the popup through a query selector, or + by looking through all registered components of a VEvent? */ + let popup = document.querySelector(`popup-element[data-uid="${uid}"]`) if (popup === null) throw new Error('no popup for uid ' + uid); - toggle_popup(popup); + popup.toggleAttribute('visible'); }); } |