mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-21 21:22:11 -03:00
feat: initialize example images manager on app startup and streamline event listener setup
This commit is contained in:
@@ -10,20 +10,32 @@ class ExampleImagesManager {
|
||||
this.startTime = null;
|
||||
this.progressPanel = null;
|
||||
|
||||
// Wait for DOM before initializing event listeners
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
this.initEventListeners();
|
||||
// Initialize progress panel reference
|
||||
this.progressPanel = document.getElementById('exampleImagesProgress');
|
||||
});
|
||||
|
||||
// Initialize download path field
|
||||
// Initialize download path field and check download status
|
||||
this.initializePathOptions();
|
||||
|
||||
// Check download status on page load
|
||||
this.checkDownloadStatus();
|
||||
}
|
||||
|
||||
// Initialize the manager
|
||||
initialize() {
|
||||
// Initialize event listeners
|
||||
this.initEventListeners();
|
||||
|
||||
// Initialize progress panel reference
|
||||
this.progressPanel = document.getElementById('exampleImagesProgress');
|
||||
|
||||
// Initialize progress panel button handlers
|
||||
const pauseBtn = document.getElementById('pauseExampleDownloadBtn');
|
||||
const collapseBtn = document.getElementById('collapseProgressBtn');
|
||||
|
||||
if (pauseBtn) {
|
||||
pauseBtn.onclick = () => this.pauseDownload();
|
||||
}
|
||||
|
||||
if (collapseBtn) {
|
||||
collapseBtn.onclick = () => this.toggleProgressPanel();
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize event listeners for buttons
|
||||
initEventListeners() {
|
||||
const downloadBtn = document.getElementById('exampleImagesDownloadBtn');
|
||||
|
||||
Reference in New Issue
Block a user