mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 16:44:23 +08:00
This commit is contained in:
1 parent
9c62847faf
commit
4d65896def
2 files changed
+12
-2
No files matched your search
@@ -1499,6 +1499,12 @@ button.outline-link:hover {
|
|||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body[data-hide-pages] .page-list-panel:has(#searchPanel:not([hidden])) {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
.page-list-panel {
|
.page-list-panel {
|
||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -437,12 +437,16 @@ function toggleSidebar(side) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateSidebarState() {
|
function updateSidebarState() {
|
||||||
|
const openingPages = state.showPages && el.pageListPanel.inert;
|
||||||
document.body.toggleAttribute("data-hide-pages", !state.showPages);
|
document.body.toggleAttribute("data-hide-pages", !state.showPages);
|
||||||
document.body.toggleAttribute("data-hide-meta", !state.showMeta);
|
document.body.toggleAttribute("data-hide-meta", !state.showMeta);
|
||||||
el.pageListPanel.inert = !state.showPages;
|
el.pageListPanel.inert = !state.showPages;
|
||||||
el.metaPanel.inert = !state.showMeta;
|
el.metaPanel.inert = !state.showMeta;
|
||||||
el.togglePagesButton.setAttribute("aria-pressed", String(state.showPages));
|
el.togglePagesButton.setAttribute("aria-pressed", String(state.showPages));
|
||||||
el.toggleMetaButton.setAttribute("aria-pressed", String(state.showMeta));
|
el.toggleMetaButton.setAttribute("aria-pressed", String(state.showMeta));
|
||||||
|
if (openingPages) {
|
||||||
|
updatePageListCurrent(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function syncLayoutMode(event) {
|
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]");
|
const current = el.pageList.querySelector(".page-list-item[aria-current]");
|
||||||
if (current) {
|
if (current) {
|
||||||
if (Number.parseInt(current.dataset.pageIndex, 10) === state.pageIndex) {
|
if (!force && Number.parseInt(current.dataset.pageIndex, 10) === state.pageIndex) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
current.removeAttribute("aria-current");
|
current.removeAttribute("aria-current");
|
||||||
|
|||||||
Reference in new issue
Block a user