Skip to content

Commit

Permalink
Improve handling of show only favorites filter (#588)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefandesu committed Oct 27, 2020
1 parent 12b6259 commit e28a7da
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/components/ConceptSchemeSelection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
</a>
</p>
<b-form-checkbox
v-if="favoriteSchemes.find(s => $jskos.isContainedIn(s, schemes))"
v-if="allowFavoriteSchemesFilter"
v-model="onlyFavorites"
size="sm">
{{ $t("schemeSelection.filterOnlyFavorites") }}
Expand Down Expand Up @@ -463,6 +463,9 @@ export default {
}
return options
},
allowFavoriteSchemesFilter() {
return !!this.favoriteSchemes.find(s => this.$jskos.isContainedIn(s, this.schemes))
},
},
watch: {
popoverShown(show) {
Expand All @@ -482,8 +485,8 @@ export default {
typeFilter() {
this.schemeFilter = ""
},
favoriteSchemes() {
if (!this.favoriteSchemes.find(s => this.$jskos.isContainedIn(s, this.schemes))) {
allowFavoriteSchemesFilter(value) {
if (!value) {
this.onlyFavorites = false
}
},
Expand All @@ -495,6 +498,9 @@ export default {
this.registryFilter = this.availableRegistries.map(r => r.uri)
this.languageFilter = this.availableLanguages.concat([null])
this.typeFilter = this.availableTypes.concat([null])
if (!this.allowFavoriteSchemesFilter) {
this.onlyFavorites = false
}
},
methods: {
clickHandlers() {
Expand Down

0 comments on commit e28a7da

Please sign in to comment.