Created svetle app
This commit is contained in:
15
frontend-plain/js/modal.js
Normal file
15
frontend-plain/js/modal.js
Normal file
@@ -0,0 +1,15 @@
|
||||
// close on button
|
||||
const close = qSA(".md-close")
|
||||
close.forEach(one => {
|
||||
one.addEventListener("click", (el) => {
|
||||
qS(".md-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")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user