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

@@ -1,7 +1,7 @@
import { state, getCurrentPageState } from '../state/index.js';
import { debounce } from './debounce.js';
import { VirtualScroller } from './VirtualScroller.js';
import { createLoraCard } from '../components/LoraCard.js';
import { createLoraCard, setupLoraCardEventDelegation } from '../components/LoraCard.js';
import { fetchLorasPage } from '../api/loraApi.js';
import { showToast } from './uiHelpers.js';
@@ -73,6 +73,11 @@ export async function initializeInfiniteScroll(pageType = 'loras') {
// Use virtual scrolling for all page types
await initializeVirtualScroll(pageType);
// Setup event delegation for lora cards if on the loras page
if (pageType === 'loras') {
setupLoraCardEventDelegation();
}
}
async function initializeVirtualScroll(pageType) {