diff --git a/passbook/static/static/passbook/pf.js b/passbook/static/static/passbook/pf.js index 4a8780884..31880461e 100644 --- a/passbook/static/static/passbook/pf.js +++ b/passbook/static/static/passbook/pf.js @@ -52,3 +52,17 @@ document.querySelectorAll("input[name=name]").forEach((input) => { slugField.value = convertToSlug(e.target.value); }); }); + +// Hamburger Menu +document.querySelector(".pf-c-page__header-brand-toggle>button").addEventListener("click", (e) => { + const sidebar = document.querySelector(".pf-c-page__sidebar"); + if (sidebar.classList.contains("pf-m-expanded")) { + // Sidebar already expanded + sidebar.classList.remove("pf-m-expanded"); + sidebar.style.zIndex = 0; + } else { + // Sidebar not expanded yet + sidebar.classList.add("pf-m-expanded"); + sidebar.style.zIndex = 200; + } +});