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

View File

@@ -0,0 +1,12 @@
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
fill="currentColor"
aria-hidden="true"
>
<path
fill-rule="evenodd"
d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z"
clip-rule="evenodd"
/>
</svg>

After

Width:  |  Height:  |  Size: 317 B

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');
}