diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-12-09 19:17:46 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-12-09 19:17:46 +0100 |
commit | 15e50471776e702333920b188932f03ee1f8573b (patch) | |
tree | 6129332e6591cbe685f999550b6891c717126401 /static/components/edit-rrule.ts | |
parent | CSS to prevent event blocks from overflowing. (diff) | |
download | calp-15e50471776e702333920b188932f03ee1f8573b.tar.gz calp-15e50471776e702333920b188932f03ee1f8573b.tar.xz |
Propagate recurring events to frontend.
This handles each instance of a recurring event as its own unique event,
which allows us to properly send it to the frontend. It's currently not
possible to submit the repeating events back, but that is probably a
underlying problem.
Diffstat (limited to '')
-rw-r--r-- | static/components/edit-rrule.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/static/components/edit-rrule.ts b/static/components/edit-rrule.ts index 6be01b76..cac19e80 100644 --- a/static/components/edit-rrule.ts +++ b/static/components/edit-rrule.ts @@ -17,6 +17,24 @@ class EditRRule extends ComponentVEvent { let frag = this.template.content.cloneNode(true) as DocumentFragment let body = frag.firstElementChild! this.replaceChildren(body); + + for (let el of this.querySelectorAll('[name]')) { + el.addEventListener('input', () => { + // console.log(this); + let data = vcal_objects.get(this.uid)!; + let rrule = data.getProperty('rrule') + if (!rrule) { + console.warn('RRUle missing from object'); + return; + } + rrule = rrule as RecurrenceRule + + console.log(el.getAttribute('name'), (el as any).value); + rrule[el.getAttribute('name')!] = (el as any).value; + data.setProperty('rrule', rrule); + + }); + } } connectedCallback() { |