mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 14:18:04 +08:00
Improve responsive design sizing for website
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
addEventListener("DOMContentLoaded", trackScrollHeadingInTOC);
|
||||
addEventListener("DOMContentLoaded", listenForClickToOpenTOC);
|
||||
|
||||
// Listen for scroll events and update the active section in the table of contents to match the visible content's heading
|
||||
function trackScrollHeadingInTOC() {
|
||||
@@ -50,3 +51,13 @@ function trackScrollHeadingInTOC() {
|
||||
addEventListener("scroll", updateVisibleHeading);
|
||||
updateVisibleHeading();
|
||||
}
|
||||
|
||||
function listenForClickToOpenTOC() {
|
||||
document.querySelector("[data-hamburger-menu-button-open]")?.addEventListener("click", () => {
|
||||
document.querySelector("[data-chapters]")?.classList.add("open");
|
||||
});
|
||||
|
||||
document.querySelector("[data-hamburger-menu-button-close]")?.addEventListener("click", () => {
|
||||
document.querySelector("[data-chapters]")?.classList.remove("open");
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user