From 7cc9ae45bc80830ec78794bba6016edb5a95563a Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 17 May 2020 23:55:13 +0200 Subject: [PATCH] static: fix any click on menu triggering collapse --- passbook/static/static/passbook/pf.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/passbook/static/static/passbook/pf.js b/passbook/static/static/passbook/pf.js index e82b27f35..3e27016ed 100644 --- a/passbook/static/static/passbook/pf.js +++ b/passbook/static/static/passbook/pf.js @@ -68,8 +68,9 @@ document.querySelector(".pf-c-page__header-brand-toggle>button").addEventListene }); // 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.classList.toggle("pf-m-expanded"); + e.preventDefault(); + menu.parentElement.classList.toggle("pf-m-expanded"); }); });