aboutsummaryrefslogtreecommitdiff
path: root/static/components
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-06-12 03:11:08 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2022-06-12 03:11:08 +0200
commitbbecd2476ebddb2731065aad2f3895c5074c9ecb (patch)
treef16f25d7fd06a7d9ca78b86b7b1c5da586394a14 /static/components
parentChange boolean attribute value to itself. (diff)
downloadcalp-bbecd2476ebddb2731065aad2f3895c5074c9ecb.tar.gz
calp-bbecd2476ebddb2731065aad2f3895c5074c9ecb.tar.xz
Stop using with-label.
Diffstat (limited to 'static/components')
-rw-r--r--static/components/vevent-edit.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/static/components/vevent-edit.ts b/static/components/vevent-edit.ts
index ee368296..bf72678c 100644
--- a/static/components/vevent-edit.ts
+++ b/static/components/vevent-edit.ts
@@ -7,7 +7,7 @@ import { DateTimeInput } from './date-time-input'
import { vcal_objects } from '../globals'
import { VEvent, RecurrenceRule } from '../vevent'
import { create_event } from '../server_connect'
-import { to_boolean } from '../lib'
+import { to_boolean, gensym } from '../lib'
/* <vevent-edit />
Edit form for a given VEvent. Used as the edit tab of popups.
@@ -24,6 +24,14 @@ class ComponentEdit extends ComponentVEvent {
let frag = this.template.content.cloneNode(true) as DocumentFragment
let body = frag.firstElementChild!
this.replaceChildren(body);
+
+ for (let el of this.querySelectorAll('[data-label]')) {
+ let label = document.createElement('label');
+ let id = el.id || gensym('input');
+ el.id = id;
+ label.htmlFor = id;
+ label.textContent = (el as HTMLElement).dataset.label!;
+ }
}
connectedCallback() {