mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-02 19:32:17 +00:00
Docs UI: Style the currently active nav link
This commit is contained in:
parent
d2dbb0001a
commit
33a6c9e6c5
2 changed files with 9 additions and 2 deletions
|
@ -14,7 +14,10 @@
|
|||
|
||||
sidebar.querySelectorAll(".sidebar-entry").forEach((entry) => {
|
||||
let entryName = entry.querySelector('.sidebar-module-link').textContent;
|
||||
if (currentModuleName === entryName) return;
|
||||
if (currentModuleName === entryName) {
|
||||
entry.firstChild.classList.add("active");
|
||||
return;
|
||||
};
|
||||
entry.querySelectorAll(".sidebar-sub-entries a").forEach((subEntry) => subEntry.classList.add("hidden"));
|
||||
})
|
||||
} else {
|
||||
|
@ -41,4 +44,4 @@
|
|||
searchBox.addEventListener("input", search);
|
||||
|
||||
search();
|
||||
})();
|
||||
})();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue