Add editor structure outline to the developer guide on the website

This commit is contained in:
Keavon Chambers
2025-07-12 23:09:29 -07:00
parent 765092fbe9
commit d6d1bbb1e6
18 changed files with 426 additions and 558 deletions
@@ -0,0 +1,17 @@
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 (nestedList) {
toggle.classList.toggle("expanded");
nestedList.classList.toggle("active");
}
});
});
// Expand the first level by default
document.querySelector(".structure-outline > ul > li > .tree-node")?.click();
});