1
0
forked from fr/deguapp
deguapp/frontend/js/modal.js
2023-11-09 01:36:43 +01:00

16 lines
392 B
JavaScript

// close on button
const close = qSA(".md-close")
close.forEach(one => {
one.addEventListener("click", (el) => {
const active = qS(".md-active")
active.classList.remove("md-active")
})
})
// close on backdrop
window.onclick = function(event) {
const active = qS(".md-active")
if (event.target == active) {
active.classList.remove("md-active")
}
}