From 3108716934dfc26c4f93eb60001f37065fef3186 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sun, 25 Jun 2023 10:01:06 +0200 Subject: flexbox is not flexible enough --- client-web/source/menu.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'client-web/source/menu.ts') diff --git a/client-web/source/menu.ts b/client-web/source/menu.ts index 3d023e2..5ecb2b2 100644 --- a/client-web/source/menu.ts +++ b/client-web/source/menu.ts @@ -49,17 +49,18 @@ export function control_bar(room: Room, side_ui_container: HTMLElement): HTMLEle export interface SideUI { el: HTMLElement, set_state: (s: boolean) => void } export function side_ui(container: HTMLElement, content: HTMLElement, label: string): SideUI { // TODO: close other side uis + const tray = ediv({ class: "side-tray" }, content) const checkbox = einput("checkbox", { onchange: () => { if (checkbox.checked) { - content.classList.add("animate-in") - container.appendChild(content) + tray.classList.add("animate-in") + container.appendChild(tray) } else { - content.classList.remove("animate-in") - content.classList.add("animate-out") + tray.classList.remove("animate-in") + tray.classList.add("animate-out") setTimeout(() => { // TODO breaks if ui is being enabled while timeout is active - content.classList.remove("animate-out") - container.removeChild(content) + tray.classList.remove("animate-out") + container.removeChild(tray) }, 400) } } -- cgit v1.2.3-70-g09d2