add nested menus capability

This commit is contained in:
madoke
2023-01-06 16:57:51 +00:00
parent b4050f08da
commit dfb18c126c
8 changed files with 116 additions and 17 deletions

11
assets/js/header.js Normal file
View File

@@ -0,0 +1,11 @@
function header_toggle_nested_menu(element) {
if (!element) {
throw new Error("Could not find button")
}
let parent_element = element.parentElement;
if(!parent_element) {
throw new Error("Could not get parent element from button")
}
let nested_menu = parent_element.querySelector(".header-nested-menu")
nested_menu.classList.toggle('hidden');
}