diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-11-30 01:09:53 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-11-30 01:09:53 +0100 |
commit | e71f0c20adc4dc2f49bca99a859241fdadf376d3 (patch) | |
tree | 3231d1e491fcd1ed9dc0ab31cac4fdedb733807d /static/lib.ts | |
parent | Change UID resolve. (diff) | |
download | calp-e71f0c20adc4dc2f49bca99a859241fdadf376d3.tar.gz calp-e71f0c20adc4dc2f49bca99a859241fdadf376d3.tar.xz |
Rework tab system.
This sepparates popup-elements from their tabbed contents, allowing
clearer sepparations of concerns, along with easier adding and removing
of tabs to the tabset!
Diffstat (limited to 'static/lib.ts')
-rw-r--r-- | static/lib.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/static/lib.ts b/static/lib.ts index bc072545..2ef5b596 100644 --- a/static/lib.ts +++ b/static/lib.ts @@ -120,11 +120,14 @@ function to_local(date: Date): Date { /* -------------------------------------------------- */ -function makeElement(name: string, attr = {}): HTMLElement { +function makeElement(name: string, attr = {}, actualAttr = {}): HTMLElement { let element: HTMLElement = document.createElement(name); for (let [key, value] of Object.entries(attr)) { (element as any)[key] = value; } + for (let [key, value] of Object.entries(actualAttr)) { + element.setAttribute(key, '' + value); + } return element; } |