Skip to content

Commit 7ea6486

Browse files
committed
fix expandables on index
1 parent e359bef commit 7ea6486

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

theme/toc.js.hbs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,8 @@ class MDBookSidebarScrollbox extends HTMLElement {
3535
parent.classList.add("expanded");
3636
}
3737
while (parent) {
38-
if (parent.tagName === "LI" && parent.previousElementSibling) {
39-
if (parent.previousElementSibling.classList.contains("chapter-item")) {
40-
parent.previousElementSibling.classList.add("expanded");
41-
}
38+
if (parent.tagName === "LI" && parent.classList.contains("chapter-item")) {
39+
parent.classList.add("expanded");
4240
}
4341
parent = parent.parentElement;
4442
}

0 commit comments

Comments
 (0)