mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-23 00:58:11 +08:00
Add editor structure outline to the developer guide on the website
This commit is contained in:
@@ -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();
|
||||
});
|
||||
Reference in New Issue
Block a user