From 4d65896defbe250db530438d3542c1db9b1fabfe Mon Sep 17 00:00:00 2001 From: xiaoqidun Date: Tue, 15 Sep 2026 08:22:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=89=8D=E7=AB=AF=E7=95=8C=E9=9D=A2):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BE=A7=E6=A0=8F=E5=B1=95=E5=BC=80=E6=97=B6?= =?UTF-8?q?=E7=9A=84=E5=BD=93=E5=89=8D=E9=A1=B5=E5=AE=9A=E4=BD=8D=E5=8F=8A?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=BB=9A=E5=8A=A8=E4=BD=8D=E7=BD=AE=E4=B8=A2?= =?UTF-8?q?=E5=A4=B1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/webui/ofdgo.css | 6 ++++++ assets/webui/ofdgo.js | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/assets/webui/ofdgo.css b/assets/webui/ofdgo.css index 7f2879c..2a0bcca 100644 --- a/assets/webui/ofdgo.css +++ b/assets/webui/ofdgo.css @@ -1499,6 +1499,12 @@ button.outline-link:hover { display: block; } + body[data-hide-pages] .page-list-panel:has(#searchPanel:not([hidden])) { + display: flex; + flex-direction: column; + overflow: hidden; + } + .page-list-panel { left: 0; } diff --git a/assets/webui/ofdgo.js b/assets/webui/ofdgo.js index 4e84ba3..69a5d74 100644 --- a/assets/webui/ofdgo.js +++ b/assets/webui/ofdgo.js @@ -437,12 +437,16 @@ function toggleSidebar(side) { } function updateSidebarState() { + const openingPages = state.showPages && el.pageListPanel.inert; document.body.toggleAttribute("data-hide-pages", !state.showPages); document.body.toggleAttribute("data-hide-meta", !state.showMeta); el.pageListPanel.inert = !state.showPages; el.metaPanel.inert = !state.showMeta; el.togglePagesButton.setAttribute("aria-pressed", String(state.showPages)); el.toggleMetaButton.setAttribute("aria-pressed", String(state.showMeta)); + if (openingPages) { + updatePageListCurrent(true); + } } function syncLayoutMode(event) { @@ -2235,10 +2239,10 @@ function setCurrentPage(index) { } } -function updatePageListCurrent() { +function updatePageListCurrent(force = false) { const current = el.pageList.querySelector(".page-list-item[aria-current]"); if (current) { - if (Number.parseInt(current.dataset.pageIndex, 10) === state.pageIndex) { + if (!force && Number.parseInt(current.dataset.pageIndex, 10) === state.pageIndex) { return; } current.removeAttribute("aria-current");