Skip to content

Commit

Permalink
frontend: add filter toggle buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
multun authored and ElysaSrc committed Jun 18, 2024
1 parent faf9342 commit 31e5d93
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions frontend/components/viewer/FilterConfig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,30 @@
{{ category.title }}
</div>
</div>
<Button
outlined
size="small"
class="m-1"
@click="invertFilteringCategories"
>
Inverser
</Button>
<Button
outlined
size="small"
class="m-1"
@click="resetFilteringCategories"
>
Réinitialiser
</Button>
<Button
outlined
size="small"
class="m-1"
@click="selectAllFilteringCategories"
>
Tout sélectionner
</Button>
</div>
<div
class="filter-settings mt-2"
Expand Down Expand Up @@ -171,6 +195,27 @@ function shownAdvancedTags() {
return base.filter(tag => tag.title.toLowerCase().includes(tagSearch.value.toLowerCase()))
}
function invertFilteringCategories() {
props.filteringCategories.forEach((category) => {
category.active = !category.active
})
categoryFiltersChanged()
}
function resetFilteringCategories() {
props.filteringCategories.forEach((category) => {
category.active = category.default_status
})
categoryFiltersChanged()
}
function selectAllFilteringCategories() {
props.filteringCategories.forEach((category) => {
category.active = true
})
categoryFiltersChanged()
}
function tagFiltersChanged() {
emit('filtersChanged')
}
Expand Down

0 comments on commit 31e5d93

Please sign in to comment.