mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-21 21:22:11 -03:00
feat: enhance LoraModal with notes hint and cleanup functionality on close
This commit is contained in:
@@ -299,7 +299,7 @@ export class ModalManager {
|
||||
return null;
|
||||
}
|
||||
|
||||
showModal(id, content = null, onCloseCallback = null) {
|
||||
showModal(id, content = null, onCloseCallback = null, cleanupCallback = null) {
|
||||
const modal = this.getModal(id);
|
||||
if (!modal) return;
|
||||
|
||||
@@ -314,9 +314,8 @@ export class ModalManager {
|
||||
}
|
||||
|
||||
// Store callback
|
||||
if (onCloseCallback) {
|
||||
modal.onCloseCallback = onCloseCallback;
|
||||
}
|
||||
modal.onCloseCallback = onCloseCallback;
|
||||
modal.cleanupCallback = cleanupCallback;
|
||||
|
||||
// Store current scroll position before showing modal
|
||||
this.scrollPosition = window.scrollY;
|
||||
@@ -362,6 +361,11 @@ export class ModalManager {
|
||||
modal.onCloseCallback();
|
||||
modal.onCloseCallback = null;
|
||||
}
|
||||
|
||||
if (modal.cleanupCallback) {
|
||||
modal.cleanupCallback();
|
||||
modal.cleanupCallback = null;
|
||||
}
|
||||
}
|
||||
|
||||
handleEscape(e) {
|
||||
|
||||
Reference in New Issue
Block a user