From 89850cadfab2d6e2c7fa173734e2f5bb8651da38 Mon Sep 17 00:00:00 2001 From: avi Date: Mon, 18 May 2026 14:11:30 -0500 Subject: [PATCH] Fix dead code removal, isolate panel close handlers, polish --- index.html | 10 ++-------- www/index.html | 10 ++-------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/index.html b/index.html index f9b2b84..161343a 100644 --- a/index.html +++ b/index.html @@ -657,11 +657,6 @@ function cmdChoose(arg){ } // ── ENDING ── -function cmdChooseConfirmed(){ - if(!G.faction){addLine('Choose a path first with CHOOSE.','warn');return;} - triggerEnding(G.faction); -} - function cmdMake(arg){ if(!G.flags.readyForEnding){addLine('Not yet. Build, listen, decode, and choose first.','warn');return;} if(!G.faction){addLine('Choose a path first with CHOOSE.','warn');return;} @@ -857,9 +852,8 @@ function startSpectrum(){ specAnimId=requestAnimationFrame(drawSpec); } drawSpec(); - document.querySelectorAll('.panel-close').forEach(b=>{ - b.onclick=()=>{if(specAnimId)cancelAnimationFrame(specAnimId);hidePanels();}; - }); + const specClose = document.querySelector('#specPanel .panel-close'); + if(specClose) specClose.onclick = ()=>{ if(specAnimId) cancelAnimationFrame(specAnimId); hidePanels(); }; } // ── FACILITY MAP ── diff --git a/www/index.html b/www/index.html index f9b2b84..161343a 100644 --- a/www/index.html +++ b/www/index.html @@ -657,11 +657,6 @@ function cmdChoose(arg){ } // ── ENDING ── -function cmdChooseConfirmed(){ - if(!G.faction){addLine('Choose a path first with CHOOSE.','warn');return;} - triggerEnding(G.faction); -} - function cmdMake(arg){ if(!G.flags.readyForEnding){addLine('Not yet. Build, listen, decode, and choose first.','warn');return;} if(!G.faction){addLine('Choose a path first with CHOOSE.','warn');return;} @@ -857,9 +852,8 @@ function startSpectrum(){ specAnimId=requestAnimationFrame(drawSpec); } drawSpec(); - document.querySelectorAll('.panel-close').forEach(b=>{ - b.onclick=()=>{if(specAnimId)cancelAnimationFrame(specAnimId);hidePanels();}; - }); + const specClose = document.querySelector('#specPanel .panel-close'); + if(specClose) specClose.onclick = ()=>{ if(specAnimId) cancelAnimationFrame(specAnimId); hidePanels(); }; } // ── FACILITY MAP ──