static: make hamburger menu work
This commit is contained in:
parent
8540e787d3
commit
9a9feea5ff
|
@ -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;
|
||||
}
|
||||
});
|
||||
|
|
Reference in a new issue