1
0
forked from fr/deguapp
deguapp/frontend/js/nav.js

25 lines
586 B
JavaScript
Raw Normal View History

2023-11-09 01:36:43 +01:00
function show_modal(selector, modal_selector = null) {
try {
if(modal_selector === null) {
modal_selector = selector
}
const btn = qS(selector)
const md = qS(modal_selector)
btn.addEventListener("click", (el) => {
md.classList.add("md-active")
})
} catch (error) {
}
}
show_modal(".nav-add", "#md-add-tree")
show_modal("#nav-login", "#md-login")
show_modal("#nav-signup", "#md-signup")
2023-11-09 17:37:21 +01:00
show_modal(".nav-user", "#md-user-tree")
2023-11-09 01:36:43 +01:00
try {
qS(".nav-user").addEventListener("click", () => {
qS(".nav-user-dropdown").classList.toggle("visible")
})
} catch (err) {
}