deguapp/frontend/js/modal.js

15 lines
362 B
JavaScript
Raw Normal View History

2023-11-09 01:36:43 +01:00
// close on button
const close = qSA(".md-close")
close.forEach(one => {
one.addEventListener("click", (el) => {
2023-11-09 17:37:21 +01:00
qS(".md-active").classList.remove("md-active")
2023-11-09 01:36:43 +01:00
})
})
// close on backdrop
window.onclick = function(event) {
const active = qS(".md-active")
if (event.target == active) {
active.classList.remove("md-active")
}
}