aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/components/LdTagInput.vue
diff options
context:
space:
mode:
authorOzoneGrif2020-04-04 04:32:31 +0200
committerGitHub2020-04-04 04:32:31 +0200
commite3a1566aca42190d486ee73612b9275560e17aa1 (patch)
tree9df4e6be5dfa15a0d27024d6857845014d84f96d /viewer/src/components/LdTagInput.vue
parentf391a682dbd725c1d8aba9c571472bd390bb6a8d (diff)
parentc26ab69997d1d552fda72b8fd88d5910fc91b779 (diff)
downloadldgallery-e3a1566aca42190d486ee73612b9275560e17aa1.tar.gz
Merge branch 'develop' into oz-overflowing-titles
Diffstat (limited to 'viewer/src/components/LdTagInput.vue')
-rw-r--r--viewer/src/components/LdTagInput.vue9
1 files changed, 8 insertions, 1 deletions
diff --git a/viewer/src/components/LdTagInput.vue b/viewer/src/components/LdTagInput.vue
index b1b9e3e..6b6e749 100644
--- a/viewer/src/components/LdTagInput.vue
+++ b/viewer/src/components/LdTagInput.vue
@@ -57,10 +57,17 @@ export default class LdTagInput extends Vue {
57 return `${option.display} (${option.items.length})`; 57 return `${option.display} (${option.items.length})`;
58 } 58 }
59 59
60 filterAlreadyPresent(newSearch: Tag.Search) {
61 return !this.model.find(
62 currentSearch =>
63 currentSearch.tag === newSearch.tag && (!currentSearch.parent || currentSearch.parent === newSearch.parent)
64 );
65 }
66
60 searchTags(filter: string) { 67 searchTags(filter: string) {
61 this.currentFilter = filter; 68 this.currentFilter = filter;
62 this.filteredTags = IndexFactory.searchTags(this.tagsIndex, filter, false) 69 this.filteredTags = IndexFactory.searchTags(this.tagsIndex, filter, false)
63 .filter(newSearch => !this.model.find(currentSearch => currentSearch.tag === newSearch.tag)) 70 .filter(this.filterAlreadyPresent)
64 .sort((a, b) => b.items.length - a.items.length); 71 .sort((a, b) => b.items.length - a.items.length);
65 } 72 }
66 73