Skip to content

Commit a9b7cd6

Browse files
committed
Fix revealing navigation
1 parent 69ad6f8 commit a9b7cd6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scala3doc/resources/dotty_res/scripts/fast-navigation-loader.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ window.addEventListener('DOMContentLoaded', () => {
2828
})
2929

3030
revealNavigationForCurrentPage = () => {
31-
let pageId = document.getElementById("content").attributes["pageIds"].value.toString();
31+
let pageIdParts = document.getElementById("content").attributes["pageIds"].value.toString().split("/")
3232
let parts = document.querySelectorAll(".sideMenuPart");
3333
let found = 0;
3434
do {
35+
let pageId = pageIdParts.join("/")
3536
parts.forEach(part => {
3637
if (part.attributes['pageId'].value.indexOf(pageId) !== -1 && found === 0) {
3738
found = 1;
@@ -42,8 +43,8 @@ revealNavigationForCurrentPage = () => {
4243
revealParents(part)
4344
}
4445
});
45-
pageId = pageId.substring(0, pageId.lastIndexOf("/"))
46-
} while (pageId.indexOf("/") !== -1 && found === 0)
46+
pageIdParts.pop()
47+
} while (pageIdParts.length > 0)
4748
};
4849

4950
revealParents = (part) => {

0 commit comments

Comments
 (0)