more style fixes

This commit is contained in:
Jacky Zhao
2025-03-09 14:49:53 -07:00
parent e320324cf2
commit d02bb0f044
3 changed files with 24 additions and 21 deletions

View File

@@ -259,14 +259,17 @@ document.addEventListener("prenav", async (e: CustomEventMap["prenav"]) => {
document.addEventListener("nav", async (e: CustomEventMap["nav"]) => {
const currentSlug = e.detail.url
// collapse explorer on mobile
for (const explorer of document.querySelectorAll(".explorer")) {
explorer.classList.add("collapsed")
explorer.setAttribute("aria-expanded", "false")
}
await setupExplorer(currentSlug)
// Hide explorer on mobile until it is requested
// if mobile hamburger is visible, collapse by default
const mobileExplorer = document.getElementById("mobile-explorer")
if (mobileExplorer && mobileExplorer.checkVisibility()) {
for (const explorer of document.querySelectorAll(".explorer")) {
explorer.classList.add("collapsed")
explorer.setAttribute("aria-expanded", "false")
}
}
const hiddenUntilDoneLoading = document.querySelector("#mobile-explorer")
hiddenUntilDoneLoading?.classList.remove("hide-until-loaded")
})