Grid fixes and such.
This commit is contained in:
parent
2199a5a693
commit
c020aa9b78
10 changed files with 387 additions and 275 deletions
|
|
@ -2,26 +2,36 @@ $(document).ready(() => {
|
|||
// Close when clicking on *not* the modal-contents
|
||||
window.onclick = (event) => {
|
||||
if (event.target.classList.contains("modal")) {
|
||||
event.target.style.visibility = 'hidden';
|
||||
event.target.style.opacity = 0;
|
||||
$(event.target).hide("fade", {
|
||||
direction: "out",
|
||||
}, 300);
|
||||
document.body.classList.remove("no-scroll");
|
||||
}
|
||||
};
|
||||
|
||||
document.querySelectorAll(".modal .close").forEach((closeBtn) => {
|
||||
closeBtn.addEventListener('click', (evt) => {
|
||||
closeBtn.parentElement.parentElement.style.visibility = 'hidden';
|
||||
closeBtn.parentElement.parentElement.style.opacity = 0;
|
||||
$(closeBtn.parentElement.parentElement).hide("fade", {
|
||||
direction: "out",
|
||||
}, 300);
|
||||
document.body.classList.remove("no-scroll");
|
||||
});
|
||||
});
|
||||
|
||||
document.querySelectorAll("[for-modal]").forEach((modalTrigerEl) => {
|
||||
modalTrigerEl.addEventListener('click', (evt) => {
|
||||
document.getElementById(modalTrigerEl.getAttribute("for-modal")).style.visibility = "visible";
|
||||
document.getElementById(modalTrigerEl.getAttribute("for-modal")).style.opacity = 1;
|
||||
// document.getElementById(modalTrigerEl.getAttribute("for-modal")).style.display = "flex";
|
||||
$(`#${modalTrigerEl.getAttribute("for-modal")}`).show("fade", {
|
||||
direction: "in",
|
||||
}, 300);
|
||||
document.body.classList.add("no-scroll");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$(document).ready(() => {
|
||||
document.querySelectorAll("[for-modal]").forEach((modalTrigerEl) => {
|
||||
$(`#${modalTrigerEl.getAttribute("for-modal")}`).hide();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue