Revert "refactor: streamline LoraCard event handling and implement virtual scrolling for improved performance"

This reverts commit 5dd8d905fa.
This commit is contained in:
Will Miao
2025-05-11 18:50:19 +08:00
parent d516f22159
commit ce7e422169
6 changed files with 195 additions and 570 deletions

View File

@@ -2,7 +2,7 @@ import { appCore } from './core.js';
import { state } from './state/index.js';
import { showLoraModal, toggleShowcase, scrollToTop } from './components/loraModal/index.js';
import { loadMoreLoras } from './api/loraApi.js';
import { updateCardsForBulkMode, setupLoraCardEventDelegation } from './components/LoraCard.js';
import { updateCardsForBulkMode } from './components/LoraCard.js';
import { bulkManager } from './managers/BulkManager.js';
import { DownloadManager } from './managers/DownloadManager.js';
import { moveManager } from './managers/MoveManager.js';
@@ -24,6 +24,7 @@ class LoraPageManager {
this.pageControls = createPageControls('loras');
// Expose necessary functions to the page that still need global access
// These will be refactored in future updates
this._exposeRequiredGlobalFunctions();
}
@@ -56,16 +57,13 @@ class LoraPageManager {
this.pageControls.initFolderTagsVisibility();
new LoraContextMenu();
// Set up event delegation for lora cards
setupLoraCardEventDelegation();
// Initialize cards for current bulk mode state
// Initialize cards for current bulk mode state (should be false initially)
updateCardsForBulkMode(state.bulkMode);
// Initialize the bulk manager
bulkManager.initialize();
// Initialize common page features (lazy loading, virtual scroll)
// Initialize common page features (lazy loading, infinite scroll)
appCore.initializePageFeatures();
}
}