From e71f0c20adc4dc2f49bca99a859241fdadf376d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 30 Nov 2021 01:09:53 +0100 Subject: 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! --- static/lib.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'static/lib.ts') 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; } -- cgit v1.2.3