This commit is contained in:
Will Miao
2025-05-12 14:50:10 +08:00
parent 311e89e9e7
commit 303477db70
4 changed files with 322 additions and 185 deletions

View File

@@ -9,6 +9,7 @@ import { exampleImagesManager } from './managers/ExampleImagesManager.js';
import { showToast, initTheme, initBackToTop, lazyLoadImages } from './utils/uiHelpers.js';
import { initializeInfiniteScroll } from './utils/infiniteScroll.js';
import { migrateStorageItems } from './utils/storageHelpers.js';
import { setupLoraCardEventDelegation } from './components/LoraCard.js';
// Core application class
export class AppCore {
@@ -63,6 +64,11 @@ export class AppCore {
// Initialize lazy loading for images on all pages
lazyLoadImages();
// Setup event delegation for lora cards if on the loras page
if (pageType === 'loras') {
setupLoraCardEventDelegation();
}
// Initialize virtual scroll for pages that need it
if (['loras', 'recipes', 'checkpoints'].includes(pageType)) {
initializeInfiniteScroll(pageType);