fix expandables on index

This commit is contained in:
Carlos Polop
2026-01-26 15:28:31 +01:00
parent e359bef3d1
commit 7ea6486f3f

View File

@@ -35,10 +35,8 @@ class MDBookSidebarScrollbox extends HTMLElement {
parent.classList.add("expanded"); parent.classList.add("expanded");
} }
while (parent) { while (parent) {
if (parent.tagName === "LI" && parent.previousElementSibling) { if (parent.tagName === "LI" && parent.classList.contains("chapter-item")) {
if (parent.previousElementSibling.classList.contains("chapter-item")) { parent.classList.add("expanded");
parent.previousElementSibling.classList.add("expanded");
}
} }
parent = parent.parentElement; parent = parent.parentElement;
} }