aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/components/LdProposition.vue
diff options
context:
space:
mode:
authorZero~Informatique2020-01-31 08:01:23 +0100
committerZero~Informatique2020-01-31 08:04:14 +0100
commita7d459a2620fa9523dd7ce8c9de519133ad5b1b7 (patch)
tree1fec46dbded6e43ddcf3252b7c638aab5f7dd7f9 /viewer/src/components/LdProposition.vue
parent63e7ef894755deef318d9dcb129a94d34f33bdf2 (diff)
downloadldgallery-a7d459a2620fa9523dd7ce8c9de519133ad5b1b7.tar.gz
viewer: tag propositions depend on current's directory. resolves #22
Diffstat (limited to 'viewer/src/components/LdProposition.vue')
-rw-r--r--viewer/src/components/LdProposition.vue6
1 files changed, 4 insertions, 2 deletions
diff --git a/viewer/src/components/LdProposition.vue b/viewer/src/components/LdProposition.vue
index 02f7fe4..a380021 100644
--- a/viewer/src/components/LdProposition.vue
+++ b/viewer/src/components/LdProposition.vue
@@ -56,8 +56,10 @@ export default class LdTagInput extends Vue {
56 .filter(rawTag => !currentTags.find(currentTag => currentTag.tag === rawTag)) 56 .filter(rawTag => !currentTags.find(currentTag => currentTag.tag === rawTag))
57 .forEach(rawTag => (propositions[rawTag] = (propositions[rawTag] ?? 0) + 1)); 57 .forEach(rawTag => (propositions[rawTag] = (propositions[rawTag] ?? 0) + 1));
58 } else { 58 } else {
59 // Tags count from the whole gallery 59 // Tags count from the current directory
60 Object.entries(this.$galleryStore.tags).forEach(entry => (propositions[entry[0]] = entry[1].items.length)); 60 this.$galleryStore.currentItem?.tags
61 .map(tag => this.$galleryStore.tags[tag]) // FIXME: Folders with the same name are merged in the index
62 .forEach(tagindex => (propositions[tagindex.tag] = tagindex.items.length));
61 } 63 }
62 64
63 return Object.entries(propositions) 65 return Object.entries(propositions)