aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/store
diff options
context:
space:
mode:
authorZero~Informatique2020-01-29 05:35:35 +0100
committerNotkea2020-01-29 21:59:12 +0100
commitc4a51940295d514dd52f48b6f18638ac554224f4 (patch)
tree56e6ab1393085f44ac71d7bc7b14b78b5d6e444d /viewer/src/store
parent8d543ab94d3678728466d3627e0d419ec00f3010 (diff)
downloadldgallery-c4a51940295d514dd52f48b6f18638ac554224f4.tar.gz
viewer: Tag auto-completion should be more flexible. Resolves #38
Diffstat (limited to 'viewer/src/store')
-rw-r--r--viewer/src/store/galleryStore.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/viewer/src/store/galleryStore.ts b/viewer/src/store/galleryStore.ts
index c4a039f..663340f 100644
--- a/viewer/src/store/galleryStore.ts
+++ b/viewer/src/store/galleryStore.ts
@@ -18,6 +18,7 @@
18*/ 18*/
19 19
20import { createModule, mutation, action } from "vuex-class-component"; 20import { createModule, mutation, action } from "vuex-class-component";
21import Tools from '@/tools';
21 22
22const VuexModule = createModule({ 23const VuexModule = createModule({
23 namespaced: "galleryStore", 24 namespaced: "galleryStore",
@@ -88,7 +89,7 @@ export default class GalleryStore extends VuexModule {
88 const parts = tag.split('.'); 89 const parts = tag.split('.');
89 let lastPart: string | null = null; 90 let lastPart: string | null = null;
90 for (const part of parts) { 91 for (const part of parts) {
91 if (!index[part]) index[part] = { tag: part, items: [], children: {} }; 92 if (!index[part]) index[part] = { tag: part, tagfiltered: Tools.normalize(part), items: [], children: {} };
92 if (!index[part].items.includes(item)) index[part].items.push(item); 93 if (!index[part].items.includes(item)) index[part].items.push(item);
93 if (lastPart) index[lastPart].children[part] = index[part]; 94 if (lastPart) index[lastPart].children[part] = index[part];
94 lastPart = part; 95 lastPart = part;