diff options
author | n-peugnet <n.peugnet@free.fr> | 2020-01-29 16:47:19 +0100 |
---|---|---|
committer | Vincent Peugnet <33429034+vincent-peugnet@users.noreply.github.com> | 2020-01-29 16:51:01 +0100 |
commit | 6a7e6bf5dea89c240daa86b404bac4e3c1b8a42a (patch) | |
tree | 5f95aba8eb4d9c6fdf1499a39a3fb8d3b268c365 | |
parent | 5d858f4673c03d05a7f3f52a991a42ab9e04da05 (diff) | |
download | wcms-6a7e6bf5dea89c240daa86b404bac4e3c1b8a42a.tar.gz wcms-6a7e6bf5dea89c240daa86b404bac4e3c1b8a42a.zip |
fix: only close the submenus of the menubar
-rw-r--r-- | src/home.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/home.js b/src/home.js index b00a782..7562389 100644 --- a/src/home.js +++ b/src/home.js @@ -11,7 +11,7 @@ window.addEventListener('load', () => { checkall.appendChild(checkbox); }); -window.addEventListener('click', clickHandler); +window.addEventListener('click', closeSubmenus); /** * Manage input event on the checkall checkbox. @@ -30,11 +30,11 @@ function checkallHandler(e) { } /** - * Manage click event on the home page. + * Close all submenus of the menubar. * @param {MouseEvent} e */ -function clickHandler(e) { - let details = document.querySelectorAll('details'); +function closeSubmenus(e) { + let details = document.querySelectorAll('aside details'); let currentDetail = e.target.closest('details'); for (const detail of details) { if (!detail.isSameNode(currentDetail)) { |