From e7d80fcfa91f92c712110d58151df0f8f1e6ed86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 21 Nov 2021 16:08:08 +0100 Subject: Rework popup components. Previously popups were driven through some CSS hacks, which used labels with specific positioning, and z-index changes. This never really worked, and led the rest of the tree to be unmanagable. This commit replaces that system with a simpler one, which is being driven by javascript. This also allowed a much simpler tree, which allowed us to - make the popups rezisable (with a resize anchor) - move the window handle to above (configurable) - Add and remove tabs without having manually reflow where all labels are --- static/components/tab-element.ts | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 static/components/tab-element.ts (limited to 'static/components/tab-element.ts') diff --git a/static/components/tab-element.ts b/static/components/tab-element.ts deleted file mode 100644 index 9da6c504..00000000 --- a/static/components/tab-element.ts +++ /dev/null @@ -1,28 +0,0 @@ -export { TabElement } - -/* */ -class TabElement extends HTMLElement { - constructor() { - super(); - } - - connectedCallback() { - let template - = (document.getElementById('tab-template') as HTMLTemplateElement) - .content - // const shadowRoot = this.attachShadow({ mode: 'open' }) - // .appendChild(template.cloneNode(true)); - - let content = Array.from(this.children, (e) => e.cloneNode(true)) - - this.replaceChildren(template.cloneNode(true)); - - let label = this.querySelector('label') - if (!label) throw "Invalid tab" - - label.setAttribute('title', this.getAttribute('label-title') || '') - label.innerText = this.getAttribute('label') || 'T' - - this.querySelector('slot[name="content"]')!.replaceWith(...content); - } -} -- cgit v1.2.3