Refactor modal close behavior: ensure consistent handling of closeOnOutsideClick option across multiple modals.

This commit is contained in:
Will Miao
2025-06-06 10:32:18 +08:00
parent 35ad872419
commit 110ffd0118

View File

@@ -45,8 +45,7 @@ export class ModalManager {
onClose: () => { onClose: () => {
this.getModal('checkpointDownloadModal').element.style.display = 'none'; this.getModal('checkpointDownloadModal').element.style.display = 'none';
document.body.classList.remove('modal-open'); document.body.classList.remove('modal-open');
}, }
closeOnOutsideClick: true
}); });
} }
@@ -69,8 +68,7 @@ export class ModalManager {
onClose: () => { onClose: () => {
this.getModal('excludeModal').element.classList.remove('show'); this.getModal('excludeModal').element.classList.remove('show');
document.body.classList.remove('modal-open'); document.body.classList.remove('modal-open');
}, }
closeOnOutsideClick: true
}); });
} }
@@ -94,7 +92,8 @@ export class ModalManager {
onClose: () => { onClose: () => {
this.getModal('settingsModal').element.style.display = 'none'; this.getModal('settingsModal').element.style.display = 'none';
document.body.classList.remove('modal-open'); document.body.classList.remove('modal-open');
} },
closeOnOutsideClick: true
}); });
} }
@@ -118,7 +117,8 @@ export class ModalManager {
onClose: () => { onClose: () => {
this.getModal('supportModal').element.style.display = 'none'; this.getModal('supportModal').element.style.display = 'none';
document.body.classList.remove('modal-open'); document.body.classList.remove('modal-open');
} },
closeOnOutsideClick: true
}); });
} }
@@ -130,7 +130,8 @@ export class ModalManager {
onClose: () => { onClose: () => {
this.getModal('updateModal').element.style.display = 'none'; this.getModal('updateModal').element.style.display = 'none';
document.body.classList.remove('modal-open'); document.body.classList.remove('modal-open');
} },
closeOnOutsideClick: true
}); });
} }