aboutsummaryrefslogtreecommitdiff
path: root/static/components/popup-element.ts
diff options
context:
space:
mode:
Diffstat (limited to 'static/components/popup-element.ts')
-rw-r--r--static/components/popup-element.ts13
1 files changed, 6 insertions, 7 deletions
diff --git a/static/components/popup-element.ts b/static/components/popup-element.ts
index 3300f885..5dc627d0 100644
--- a/static/components/popup-element.ts
+++ b/static/components/popup-element.ts
@@ -15,12 +15,12 @@ class PopupElement extends ComponentVEvent {
* the top, and allowing global keyboard bindings to affect it. */
static activePopup: PopupElement | null = null;
- constructor(uid?: string) {
- super(uid);
+ constructor(uid?: string, instance?: string) {
+ super(uid, instance);
/* TODO populate remaining (??) */
- let obj = vcal_objects.get(this.uid);
+ let obj = this.getData();
if (obj && obj.calendar) {
this.dataset.calendar = obj.calendar;
}
@@ -48,8 +48,6 @@ class PopupElement extends ComponentVEvent {
let template = document.getElementById('popup-template') as HTMLTemplateElement
let body = (template.content.cloneNode(true) as DocumentFragment).firstElementChild!;
- let uid = this.uid;
-
/* nav bar */
let nav = body.getElementsByClassName("popup-control")[0] as HTMLElement;
bind_popup_control(nav);
@@ -61,7 +59,8 @@ class PopupElement extends ComponentVEvent {
maximize_btn.addEventListener('click', () => this.maximize());
let remove_btn = body.querySelector('.popup-control .remove-button') as HTMLButtonElement
- remove_btn.addEventListener('click', () => remove_event(uid));
+ /* TODO repeating removal */
+ remove_btn.addEventListener('click', () => remove_event(this.uid));
/* end nav bar */
this.replaceChildren(body);
@@ -147,7 +146,7 @@ class PopupElement extends ComponentVEvent {
*/
function setup_popup_element(ev: VEvent): PopupElement {
let uid = ev.getProperty('uid');
- let popup = new PopupElement(uid);
+ let popup = new PopupElement(uid, ev.getProperty('dtstart')?.format('~Y-~m-~dT~H:~M:~S'));
ev.register(popup);
/* TODO propper way to find popup container */
(document.querySelector('.days') as Element).appendChild(popup);