mirror of
https://github.com/Kozea/Radicale.git
synced 2025-07-26 17:58:30 +00:00
Implement side menu for narrow screens
This commit is contained in:
parent
ec4f2a40d6
commit
b9c93d3e11
6 changed files with 122 additions and 29 deletions
15
beta/assets/narrow-menu.js
Normal file
15
beta/assets/narrow-menu.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
window.addEventListener("load", function() {
|
||||
document.querySelector("button[data-name=nav-open]").addEventListener("click", function() {
|
||||
document.documentElement.classList.add("nav-opened");
|
||||
});
|
||||
document.querySelector("button[data-name=nav-close]").addEventListener("click", function() {
|
||||
document.documentElement.classList.remove("nav-opened");
|
||||
});
|
||||
for (let link of document.querySelectorAll("nav a")) {
|
||||
link.addEventListener("click", function() {
|
||||
if (link.parentElement.classList.contains("active") || link.parentElement.classList.contains("level4")) {
|
||||
document.documentElement.classList.remove("nav-opened");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue