1
0
forked from ScoDoc/ScoDoc

Assiduité : Prompt : blocage scroll + fermeture on success

This commit is contained in:
Iziram 2024-03-11 11:33:05 +01:00
parent 959a98d0a2
commit be227f4a2f

View File

@ -182,6 +182,9 @@
promptModal.removeEventListener('click', this)
}
})
document.body.style.overflow = "hidden";
}
function promptModalButtonAction(success, cancel) {
@ -189,7 +192,7 @@
succBtn.classList.add("btnPrompt")
succBtn.textContent = "Valider"
succBtn.addEventListener('click', () => {
const retour = success();
const retour = success(closePromptModal);
if (retour == null || retour == false || retour == undefined) {
closePromptModal();
}
@ -207,6 +210,7 @@
function closePromptModal() {
promptModal.classList.remove("is-active")
document.body.style.overflow = "auto";
}
const promptClose = document.querySelector(".promptModal-close");
promptClose.onclick = function () {