diff --git a/komga-webui/src/components/FilterDrawer.vue b/komga-webui/src/components/FilterDrawer.vue
index 00b359538..4b13cdc43 100644
--- a/komga-webui/src/components/FilterDrawer.vue
+++ b/komga-webui/src/components/FilterDrawer.vue
@@ -7,6 +7,22 @@
disable-route-watcher
class="fill-height"
>
+
+
+ mdi-filter-variant-remove
+
+
+
@@ -36,15 +52,24 @@ export default Vue.extend({
},
props: {
value: Boolean,
+ clearButton: {
+ type: Boolean,
+ default: false,
+ },
},
watch: {
- value (val) {
+ value(val) {
this.display = val
},
- display (val) {
+ display(val) {
!val && this.$emit('input', false)
},
},
+ methods: {
+ clear() {
+ this.$emit('clear')
+ },
+ },
})
diff --git a/komga-webui/src/locales/en.json b/komga-webui/src/locales/en.json
index cd2e4d2d3..4a2191e7b 100644
--- a/komga-webui/src/locales/en.json
+++ b/komga-webui/src/locales/en.json
@@ -181,7 +181,8 @@
"series": "Series",
"tags": "Tags",
"use_filter_panel_to_change_filter": "Use the filter panel to change the active filter",
- "year": "year"
+ "year": "year",
+ "reset_filters": "Reset filters"
},
"dashboard": {
"keep_reading": "Keep Reading",
diff --git a/komga-webui/src/views/BrowseCollection.vue b/komga-webui/src/views/BrowseCollection.vue
index 4c3e8ae66..007d5ba01 100644
--- a/komga-webui/src/views/BrowseCollection.vue
+++ b/komga-webui/src/views/BrowseCollection.vue
@@ -65,7 +65,11 @@
-
+
+ {{ $t('common.reset_filters') }}
({
diff --git a/komga-webui/src/views/BrowseLibraries.vue b/komga-webui/src/views/BrowseLibraries.vue
index 9d1f70c17..406cab514 100644
--- a/komga-webui/src/views/BrowseLibraries.vue
+++ b/komga-webui/src/views/BrowseLibraries.vue
@@ -36,7 +36,11 @@
-
+
+ {{ $t('common.reset_filters') }}
@@ -283,6 +288,16 @@ export default Vue.extend({
},
},
methods: {
+ resetSortAndFilters() {
+ this.drawer = false
+ for (const prop in this.filters) {
+ this.$set(this.filters, prop, [])
+ }
+ this.sortActive = this.sortDefault
+ this.$store.commit('setLibraryFilter', {id: this.libraryId, filter: this.filters})
+ this.$store.commit('setLibrarySort', {id: this.libraryId, sort: this.sortActive})
+ this.updateRouteAndReload()
+ },
async resetParams(route: any, libraryId: string) {
this.sortActive = parseQuerySort(route.query.sort, this.sortOptions) ||
this.$store.getters.getLibrarySort(route.params.libraryId) ||
diff --git a/komga-webui/src/views/BrowseSeries.vue b/komga-webui/src/views/BrowseSeries.vue
index 4ff4ed74e..9d81b6711 100644
--- a/komga-webui/src/views/BrowseSeries.vue
+++ b/komga-webui/src/views/BrowseSeries.vue
@@ -47,7 +47,11 @@
@edit="editMultipleBooks"
/>
-
+