From 1a35bd81bdf13075b328eb7ba637f454c5e8a5d5 Mon Sep 17 00:00:00 2001 From: mkelvers Date: Tue, 9 Jun 2026 12:36:26 +0200 Subject: [PATCH] fix: preserve schedule source items --- static/schedule_board.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/static/schedule_board.ts b/static/schedule_board.ts index b1ba21a..02d662e 100644 --- a/static/schedule_board.ts +++ b/static/schedule_board.ts @@ -229,6 +229,8 @@ const buildBoard = (section: HTMLElement): void => { const source = section.querySelector("[data-schedule-items-source]"); if (!board || !source) return; + const sourceItems = Array.from(source.querySelectorAll("[data-schedule-item]")); + const settings = loadSettings(); const render = (): void => { @@ -269,10 +271,12 @@ const buildBoard = (section: HTMLElement): void => { if (countNode) countNode.textContent = "0"; } - const rawItems = Array.from(source.querySelectorAll("[data-schedule-item]")); const parsed: Item[] = []; - for (const node of rawItems) { + for (const sourceItem of sourceItems) { + const node = sourceItem.cloneNode(true); + if (!(node instanceof HTMLElement)) continue; + const title = node.getAttribute("data-title") ?? ""; const score = Number(node.getAttribute("data-score") ?? "0"); const slot = getLocalSlot(