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:
Will Miao
2025-03-17 17:41:41 +08:00
parent 14a88e2cfa
commit 1bfe12a288
3 changed files with 8 additions and 12 deletions

View File

@@ -21,6 +21,13 @@ export class FilterManager {
initialize() {
// Create base model filter tags
this.createBaseModelTags();
// Add click handler for filter button
if (this.filterButton) {
this.filterButton.addEventListener('click', () => {
this.toggleFilterPanel();
});
}
// Close filter panel when clicking outside
document.addEventListener('click', (e) => {