Refactor LoraModal and RecipeSearchManager for improved functionality and performance

- Updated LoraModal to enhance lazy loading and scroll behavior, utilizing MutationObserver for dynamic content changes and adding a new helper function for the back-to-top button.
- Modified RecipeSearchManager to ensure proper recipe loading through the window.recipeManager object, improving reliability in recipe reloading.
- Added additional components to loras.html for better modularity and organization of the modal structure.
This commit is contained in:
Will Miao
2025-03-19 16:15:18 +08:00
parent f9c54690b0
commit 7924e4000c
5 changed files with 164 additions and 134 deletions

View File

@@ -111,13 +111,11 @@ export class RecipeSearchManager extends SearchManager {
}
resetAndReloadRecipes() {
// This function would be implemented in the recipes page
// Similar to resetAndReload for loras
if (typeof window.loadRecipes === 'function') {
window.loadRecipes();
if (window.recipeManager && typeof window.recipeManager.loadRecipes === 'function') {
window.recipeManager.loadRecipes();
} else {
// Fallback to reloading the page
window.location.reload();
window.location.reload();
}
}