mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-25 23:25:43 -03:00
Add filter button functionality and clean up recipe template scripts
- Implemented click handler for the filter button in FilterManager to toggle the filter panel. - Removed redundant recipe filter manager initialization from recipes.html for cleaner code. - Updated header.html to remove inline JavaScript for filter button, enhancing maintainability.
This commit is contained in:
@@ -22,6 +22,13 @@ export class FilterManager {
|
|||||||
// Create base model filter tags
|
// Create base model filter tags
|
||||||
this.createBaseModelTags();
|
this.createBaseModelTags();
|
||||||
|
|
||||||
|
// Add click handler for filter button
|
||||||
|
if (this.filterButton) {
|
||||||
|
this.filterButton.addEventListener('click', () => {
|
||||||
|
this.toggleFilterPanel();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Close filter panel when clicking outside
|
// Close filter panel when clicking outside
|
||||||
document.addEventListener('click', (e) => {
|
document.addEventListener('click', (e) => {
|
||||||
if (!this.filterPanel.contains(e.target) &&
|
if (!this.filterPanel.contains(e.target) &&
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<button class="search-options-toggle" id="searchOptionsToggle" title="Search Options">
|
<button class="search-options-toggle" id="searchOptionsToggle" title="Search Options">
|
||||||
<i class="fas fa-sliders-h"></i>
|
<i class="fas fa-sliders-h"></i>
|
||||||
</button>
|
</button>
|
||||||
<button class="search-filter-toggle" id="filterButton" onclick="filterManager.toggleFilterPanel()" title="Filter models">
|
<button class="search-filter-toggle" id="filterButton" title="Filter models">
|
||||||
<i class="fas fa-filter"></i>
|
<i class="fas fa-filter"></i>
|
||||||
<span class="filter-badge" id="activeFiltersCount" style="display: none">0</span>
|
<span class="filter-badge" id="activeFiltersCount" style="display: none">0</span>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -133,17 +133,6 @@
|
|||||||
</script>
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<!-- Recipe page specific scripts -->
|
|
||||||
<script type="module">
|
|
||||||
import { RecipeFilterManager } from '/loras_static/js/managers/RecipeFilterManager.js';
|
|
||||||
|
|
||||||
// Initialize the recipe filter manager
|
|
||||||
window.recipeFilterManager = new RecipeFilterManager();
|
|
||||||
|
|
||||||
// Make it globally available
|
|
||||||
window.filterManager = window.recipeFilterManager; // For compatibility with existing code
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Refresh recipes
|
// Refresh recipes
|
||||||
function refreshRecipes() {
|
function refreshRecipes() {
|
||||||
|
|||||||
Reference in New Issue
Block a user