Refactor ModalManager to conditionally register modals based on their existence

- Updated ModalManager to check for the presence of modals before registration, improving performance and preventing errors on pages without certain modals.
- Added support for closing modals when clicking outside of them, enhancing user experience.
- Ensured consistent handling of modal display properties across various modal types.
This commit is contained in:
Will Miao
2025-03-19 16:36:07 +08:00
parent 7924e4000c
commit 32fa81cf93
2 changed files with 96 additions and 66 deletions

View File

@@ -92,6 +92,7 @@
const importModal = document.getElementById('importModal');
if (importModal) {
importModal.classList.remove('hidden');
importModal.style.display = 'block';
}
}
</script>