aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/components/LdProposition.vue
diff options
context:
space:
mode:
Diffstat (limited to 'viewer/src/components/LdProposition.vue')
-rw-r--r--viewer/src/components/LdProposition.vue9
1 files changed, 5 insertions, 4 deletions
diff --git a/viewer/src/components/LdProposition.vue b/viewer/src/components/LdProposition.vue
index aa44943..2396d1f 100644
--- a/viewer/src/components/LdProposition.vue
+++ b/viewer/src/components/LdProposition.vue
@@ -54,8 +54,9 @@
54</template> 54</template>
55 55
56<script lang="ts"> 56<script lang="ts">
57import { Component, Vue, Prop, PropSync, Watch } from "vue-property-decorator"; 57import { Item, RawTag } from "@/@types/gallery";
58import { Operation } from "@/@types/Operation"; 58import { Operation } from "@/@types/Operation";
59import { Component, Prop, PropSync, Vue, Watch } from "vue-property-decorator";
59 60
60@Component 61@Component
61export default class LdProposition extends Vue { 62export default class LdProposition extends Vue {
@@ -118,16 +119,16 @@ export default class LdProposition extends Vue {
118 return this.category?.tag ?? this.$t("panelLeft.propositions.other"); 119 return this.category?.tag ?? this.$t("panelLeft.propositions.other");
119 } 120 }
120 121
121 extractDistinctItems(currentTags: Tag.Search[]): Gallery.Item[] { 122 extractDistinctItems(currentTags: Tag.Search[]): Item[] {
122 return [...new Set(currentTags.flatMap(tag => tag.items))]; 123 return [...new Set(currentTags.flatMap(tag => tag.items))];
123 } 124 }
124 125
125 rightmost(tag: Gallery.RawTag): Gallery.RawTag { 126 rightmost(tag: RawTag): RawTag {
126 const dot = tag.lastIndexOf(":"); 127 const dot = tag.lastIndexOf(":");
127 return dot <= 0 ? tag : tag.substr(dot + 1); 128 return dot <= 0 ? tag : tag.substr(dot + 1);
128 } 129 }
129 130
130 add(operation: Operation, rawTag: Gallery.RawTag) { 131 add(operation: Operation, rawTag: RawTag) {
131 const node = this.tagsIndex[rawTag]; 132 const node = this.tagsIndex[rawTag];
132 const display = this.category ? `${operation}${this.category.tag}:${node.tag}` : `${operation}${node.tag}`; 133 const display = this.category ? `${operation}${this.category.tag}:${node.tag}` : `${operation}${node.tag}`;
133 this.model.push({ ...node, parent: this.category, operation, display }); 134 this.model.push({ ...node, parent: this.category, operation, display });