Skip to content

Commit bfafec5

Browse files
committed
fix expandable index
1 parent 454ae14 commit bfafec5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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)