Modernize and fix website build tooling deps and utilize JS type checking (#3348)

* Modernize and fix website build tooling deps and utilize JS type checking

* Upgrade to the latest Node.js
This commit is contained in:
Keavon Chambers
2025-11-06 16:30:35 -08:00
committed by GitHub
parent 96d73a8570
commit 6b315c3b68
18 changed files with 2036 additions and 981 deletions

View File

@@ -2,9 +2,9 @@ document.addEventListener("DOMContentLoaded", () => {
document.querySelectorAll(".tree-node").forEach((toggle) => {
toggle.addEventListener("click", (event) => {
// Prevent link click from also toggling parent
if (event.target.tagName === "A") return;
const nestedList = toggle.parentElement.querySelector(".nested");
if (event.target instanceof HTMLElement && event.target.tagName === "A") return;
const nestedList = toggle.parentElement?.querySelector(".nested");
if (nestedList) {
toggle.classList.toggle("expanded");
nestedList.classList.toggle("active");
@@ -13,5 +13,6 @@ document.addEventListener("DOMContentLoaded", () => {
});
// Expand the first level by default
document.querySelector(".structure-outline > ul > li > .tree-node")?.click();
const firstLevel = document.querySelector(".structure-outline > ul > li > .tree-node");
if (firstLevel instanceof HTMLElement) firstLevel.click();
});