diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-11-10 00:47:10 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-11-10 00:47:10 +0100 |
commit | c60a60422f69e29628b6c946a15be271e90015aa (patch) | |
tree | 258d128b50f5f162b1feb5e9416f6062ca51fb72 /static/globals.ts | |
parent | Handle calendar change through dropdown. (diff) | |
download | calp-c60a60422f69e29628b6c946a15be271e90015aa.tar.gz calp-c60a60422f69e29628b6c946a15be271e90015aa.tar.xz |
Basic event modification works again.
Diffstat (limited to '')
-rw-r--r-- | static/globals.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/static/globals.ts b/static/globals.ts index daf5a2f7..5187d007 100644 --- a/static/globals.ts +++ b/static/globals.ts @@ -8,6 +8,7 @@ import { close_popup, toggle_popup } from './popup' import { VEvent, xml_to_vcal } from './vevent' import { bind_popup_control } from './dragable' import { uid, parseDate, gensym, to_local, boolean, makeElement } from './lib' +import { create_event } from './server_connect' const vcal_objects: Map<uid, VEvent> = new Map; (window as any).vcal_objects = vcal_objects; @@ -188,6 +189,15 @@ class ComponentEdit extends ComponentVEvent { el.value) }); } + + let submit = this.querySelector('form') as HTMLFormElement + submit.addEventListener('submit', (e) => { + console.log(submit, e); + create_event(vcal_objects.get(this.uid)!); + + e.preventDefault(); + return false; + }); } redraw(data: VEvent) { |