lint codebase

This commit is contained in:
AlecM33
2022-01-11 20:36:10 -05:00
parent 553f1025a8
commit f5c0984211
38 changed files with 2422 additions and 968 deletions

View File

@@ -1,9 +1,9 @@
export const ModalManager = {
displayModal: displayModal,
dispelModal: dispelModal
}
};
function displayModal(modalId, backgroundId, closeButtonId) {
function displayModal (modalId, backgroundId, closeButtonId) {
const modal = document.getElementById(modalId);
const modalOverlay = document.getElementById(backgroundId);
const closeBtn = document.getElementById(closeButtonId);
@@ -11,19 +11,19 @@ function displayModal(modalId, backgroundId, closeButtonId) {
if (modal && modalOverlay && closeBtn) {
modal.style.display = 'flex';
modalOverlay.style.display = 'flex';
modalOverlay.removeEventListener("click", closeModalHandler);
modalOverlay.addEventListener("click", closeModalHandler = function(e) {
modalOverlay.removeEventListener('click', closeModalHandler);
modalOverlay.addEventListener('click', closeModalHandler = function (e) {
e.preventDefault();
dispelModal(modalId, backgroundId);
});
closeBtn.removeEventListener("click", closeModalHandler);
closeBtn.addEventListener("click", closeModalHandler);
closeBtn.removeEventListener('click', closeModalHandler);
closeBtn.addEventListener('click', closeModalHandler);
} else {
throw new Error("One or more of the ids supplied to ModalManager.displayModal is invalid.");
throw new Error('One or more of the ids supplied to ModalManager.displayModal is invalid.');
}
}
function dispelModal(modalId, backgroundId) {
function dispelModal (modalId, backgroundId) {
const modal = document.getElementById(modalId);
const modalOverlay = document.getElementById(backgroundId);
if (modal && modalOverlay) {