Add cache management feature: implement clear cache API and modal confirmation

This commit is contained in:
Will Miao
2025-05-29 14:36:13 +08:00
parent afb012029f
commit ddf132bd78
5 changed files with 136 additions and 2 deletions

View File

@@ -170,6 +170,18 @@ export class ModalManager {
});
}
// Add clearCacheModal registration
const clearCacheModal = document.getElementById('clearCacheModal');
if (clearCacheModal) {
this.registerModal('clearCacheModal', {
element: clearCacheModal,
onClose: () => {
this.getModal('clearCacheModal').element.classList.remove('show');
document.body.classList.remove('modal-open');
}
});
}
// Set up event listeners for modal toggles
const supportToggle = document.getElementById('supportToggleBtn');
if (supportToggle) {
@@ -233,7 +245,7 @@ export class ModalManager {
// Store current scroll position before showing modal
this.scrollPosition = window.scrollY;
if (id === 'deleteModal' || id === 'excludeModal' || id === 'duplicateDeleteModal') {
if (id === 'deleteModal' || id === 'excludeModal' || id === 'duplicateDeleteModal' || id === 'clearCacheModal') {
modal.element.classList.add('show');
} else {
modal.element.style.display = 'block';