diff options
author | Simone <26844016+simonebortolin@users.noreply.github.com> | 2022-12-30 17:54:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-30 17:54:00 +0100 |
commit | 9b16504485a14b477aa00ae33a43d91e7e4ce9e6 (patch) | |
tree | 5e1d9aba2b5e70055ed96daba87786d80cc6085e /assets/js/modal.js | |
parent | Hot fix pages.yml (#74) (diff) | |
download | hack-gpon.github.io-9b16504485a14b477aa00ae33a43d91e7e4ce9e6.tar hack-gpon.github.io-9b16504485a14b477aa00ae33a43d91e7e4ce9e6.tar.gz hack-gpon.github.io-9b16504485a14b477aa00ae33a43d91e7e4ce9e6.tar.bz2 hack-gpon.github.io-9b16504485a14b477aa00ae33a43d91e7e4ce9e6.tar.lz hack-gpon.github.io-9b16504485a14b477aa00ae33a43d91e7e4ce9e6.tar.xz hack-gpon.github.io-9b16504485a14b477aa00ae33a43d91e7e4ce9e6.tar.zst hack-gpon.github.io-9b16504485a14b477aa00ae33a43d91e7e4ce9e6.zip |
Diffstat (limited to '')
-rw-r--r-- | assets/js/modal.js | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/assets/js/modal.js b/assets/js/modal.js deleted file mode 100644 index c18d751..0000000 --- a/assets/js/modal.js +++ /dev/null @@ -1,28 +0,0 @@ -var modals = document.querySelectorAll("[data-modal]"); -var modalToogles = document.querySelectorAll("[data-toogle=modal]"); - -[...modals].forEach(modal => { - var closeBtns = modal.getElementsByClassName("close"); - [...closeBtns].forEach(closeBtn => { - closeBtn.addEventListener("click", (event) => { - modal.style.display = "none"; - modal.dispatchEvent( new Event('modal-close')); - }); - }) -}); - -[...modalToogles].forEach(toogle => { - toogle.addEventListener("click", (event) => { - var modal = document.querySelector(toogle.getAttribute('data-target')); - modal.style.display = "block"; - modal.dispatchEvent(new Event('modal-open')); - }); -}); - -window.addEventListener("click", function(event) { - if ([...modals].filter(modal => modal.getAttribute("data-modal-backdrop") !== "static").includes(event.target)) { - event.target.dispatchEvent( new Event('modal-close')); - event.target.style.display = "none"; - } -}); - |