mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 17:27:08 +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;
|
||||
}
|
||||
|
||||
body[data-hide-pages] .page-list-panel:has(#searchPanel:not([hidden])) {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.page-list-panel {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in new issue
Block a user