mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-25 23:25:43 -03:00
Enhance modal toggle functionality and update service interaction
This commit is contained in:
@@ -72,6 +72,12 @@ export class ModalManager {
|
||||
}
|
||||
});
|
||||
|
||||
// Set up event listeners for modal toggles
|
||||
const supportToggle = document.getElementById('supportToggleBtn');
|
||||
if (supportToggle) {
|
||||
supportToggle.addEventListener('click', () => this.toggleModal('supportModal'));
|
||||
}
|
||||
|
||||
document.addEventListener('keydown', this.boundHandleEscape);
|
||||
this.initialized = true;
|
||||
}
|
||||
@@ -173,6 +179,20 @@ export class ModalManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
toggleModal(id, content = null, onCloseCallback = null) {
|
||||
const modal = this.getModal(id);
|
||||
if (!modal) return;
|
||||
|
||||
// If this modal is already open, close it
|
||||
if (modal.isOpen) {
|
||||
this.closeModal(id);
|
||||
return;
|
||||
}
|
||||
|
||||
// Otherwise, show the modal
|
||||
this.showModal(id, content, onCloseCallback);
|
||||
}
|
||||
}
|
||||
|
||||
// Create and export a singleton instance
|
||||
|
||||
Reference in New Issue
Block a user