diff options
Diffstat (limited to 'viewer/src/components/LdTagInput.vue')
-rw-r--r-- | viewer/src/components/LdTagInput.vue | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/viewer/src/components/LdTagInput.vue b/viewer/src/components/LdTagInput.vue index bdb07bc..865db96 100644 --- a/viewer/src/components/LdTagInput.vue +++ b/viewer/src/components/LdTagInput.vue | |||
@@ -54,9 +54,16 @@ export default class LdTagInput extends Vue { | |||
54 | return `${option.display} (${option.items.length})`; | 54 | return `${option.display} (${option.items.length})`; |
55 | } | 55 | } |
56 | 56 | ||
57 | filterAlreadyPresent(newSearch: Tag.Search) { | ||
58 | return !this.model.find( | ||
59 | currentSearch => | ||
60 | currentSearch.tag === newSearch.tag && (!currentSearch.parent || currentSearch.parent === newSearch.parent) | ||
61 | ); | ||
62 | } | ||
63 | |||
57 | searchTags(filter: string) { | 64 | searchTags(filter: string) { |
58 | this.filteredTags = IndexFactory.searchTags(this.tagsIndex, filter, false) | 65 | this.filteredTags = IndexFactory.searchTags(this.tagsIndex, filter, false) |
59 | .filter(newSearch => !this.model.find(currentSearch => currentSearch.tag === newSearch.tag)) | 66 | .filter(this.filterAlreadyPresent) |
60 | .sort((a, b) => b.items.length - a.items.length); | 67 | .sort((a, b) => b.items.length - a.items.length); |
61 | } | 68 | } |
62 | 69 | ||