From 4924a4ae0602e19ce9d622ee9a28fbecb8078fce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=20Randall=20Havens=20=E2=96=B3=20The=20Empathic=20Tec?= =?UTF-8?q?hnologist=20=E2=9F=81=20Doctor=20Who=2042?= Date: Sat, 8 Nov 2025 19:17:07 -0600 Subject: [PATCH] Update app.js --- public/app.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/public/app.js b/public/app.js index 6ee2713..a53ce94 100755 --- a/public/app.js +++ b/public/app.js @@ -15,7 +15,6 @@ const els = { let indexData = null; let sidebarOpen = false; -let currentIframe = null; async function init() { try { @@ -34,11 +33,13 @@ async function init() { function populateNav() { els.primaryNav.innerHTML = 'Home'; - indexData.sections.forEach(s => { - const hasIndex = indexData.flat.some(f => f.path.startsWith(s + "/") && f.isIndex); - if (hasIndex) { - els.primaryNav.innerHTML += `${s.charAt(0).toUpperCase() + s.slice(1)}`; - } + const navSections = [...new Set( + indexData.flat + .filter(f => f.isIndex) + .map(f => f.path.split("/")[0]) + )].sort(); + navSections.forEach(s => { + els.primaryNav.innerHTML += `${s.charAt(0).toUpperCase() + s.slice(1)}`; }); } @@ -169,8 +170,6 @@ function renderIframe(rel) { iframe.setAttribute("sandbox", "allow-same-origin allow-scripts allow-forms"); els.viewer.appendChild(iframe); - currentIframe = iframe; - iframe.onload = () => { try { const doc = iframe.contentDocument;