improved modal exit on mobile

This commit is contained in:
Keep Creating Online
2025-02-01 19:59:40 -05:00
parent f216e6838d
commit 040e8a0301

View File

@@ -345,12 +345,18 @@
// Just load the login modal (or any others), without adding event listeners here.
// The logic to open/close the modal is all in app.js now.
Promise.all([
loadModal("components/login-modal.html"),
// e.g. loadModal("components/upload-modal.html"),
// loadModal("components/profile-modal.html"),
]).then(() => {
Promise.all([loadModal("components/login-modal.html")]).then(() => {
console.log("Modals loaded (login-modal.html, etc.)");
// Now that the login-modal is definitely in the DOM:
const closeBtn = document.getElementById("closeLoginModal");
if (closeBtn) {
closeBtn.addEventListener("click", () => {
const loginModal = document.getElementById("loginModal");
if (loginModal) {
loginModal.classList.add("hidden");
}
});
}
});
</script>