static: fix any click on menu triggering collapse

This commit is contained in:
Jens Langhammer 2020-05-17 23:55:13 +02:00
parent 09ef58350c
commit 7cc9ae45bc

View file

@ -68,8 +68,9 @@ document.querySelector(".pf-c-page__header-brand-toggle>button").addEventListene
}); });
// Collapsable Menus in Sidebar // Collapsable Menus in Sidebar
document.querySelectorAll(".pf-m-expandable").forEach((menu) => { document.querySelectorAll(".pf-m-expandable>.pf-c-nav__link").forEach((menu) => {
menu.addEventListener("click", (e) => { menu.addEventListener("click", (e) => {
menu.classList.toggle("pf-m-expanded"); e.preventDefault();
menu.parentElement.classList.toggle("pf-m-expanded");
}); });
}); });