diff options
Diffstat (limited to 'viewer')
-rw-r--r-- | viewer/src/components/LdCommandSearch.vue | 6 | ||||
-rw-r--r-- | viewer/src/components/LdGallery.vue | 8 | ||||
-rw-r--r-- | viewer/src/store/galleryStore.ts | 10 | ||||
-rw-r--r-- | viewer/src/views/GallerySearch.vue | 1 | ||||
-rw-r--r-- | viewer/src/views/MainLayout.vue | 2 | ||||
-rw-r--r-- | viewer/src/views/PanelLeft.vue | 6 |
6 files changed, 16 insertions, 17 deletions
diff --git a/viewer/src/components/LdCommandSearch.vue b/viewer/src/components/LdCommandSearch.vue index bd18060..3d95eb0 100644 --- a/viewer/src/components/LdCommandSearch.vue +++ b/viewer/src/components/LdCommandSearch.vue | |||
@@ -23,7 +23,7 @@ | |||
23 | <fa-icon icon="eraser" /> | 23 | <fa-icon icon="eraser" /> |
24 | <span>{{$t('command.search.clear')}}</span> | 24 | <span>{{$t('command.search.clear')}}</span> |
25 | </b-button> | 25 | </b-button> |
26 | <b-button expanded :loading="loading" @click="search"> | 26 | <b-button expanded @click="search"> |
27 | <fa-icon icon="search" /> | 27 | <fa-icon icon="search" /> |
28 | <span>{{$t('command.search.search')}}</span> | 28 | <span>{{$t('command.search.search')}}</span> |
29 | </b-button> | 29 | </b-button> |
@@ -35,8 +35,6 @@ import { Component, Vue, Emit } from "vue-property-decorator"; | |||
35 | 35 | ||
36 | @Component | 36 | @Component |
37 | export default class LdCommandSearch extends Vue { | 37 | export default class LdCommandSearch extends Vue { |
38 | loading: boolean = false; | ||
39 | |||
40 | @Emit() | 38 | @Emit() |
41 | clear(e: HTMLButtonElement) { | 39 | clear(e: HTMLButtonElement) { |
42 | return e; | 40 | return e; |
@@ -44,8 +42,6 @@ export default class LdCommandSearch extends Vue { | |||
44 | 42 | ||
45 | @Emit() | 43 | @Emit() |
46 | search(e: HTMLButtonElement) { | 44 | search(e: HTMLButtonElement) { |
47 | this.loading = true; | ||
48 | this.$nextTick(() => (this.loading = false)); | ||
49 | return e; | 45 | return e; |
50 | } | 46 | } |
51 | } | 47 | } |
diff --git a/viewer/src/components/LdGallery.vue b/viewer/src/components/LdGallery.vue index 16e9f7c..cd4bc28 100644 --- a/viewer/src/components/LdGallery.vue +++ b/viewer/src/components/LdGallery.vue | |||
@@ -19,11 +19,9 @@ | |||
19 | 19 | ||
20 | <template> | 20 | <template> |
21 | <div class="thumbnail-tiles"> | 21 | <div class="thumbnail-tiles"> |
22 | <div v-for="item in items" :key="item.path"> | 22 | <router-link v-for="item in items" :key="item.path" :to="item.path"> |
23 | <router-link :to="item.path"> | 23 | <ld-thumbnail :item="item" /> |
24 | <ld-thumbnail :item="item" /> | 24 | </router-link> |
25 | </router-link> | ||
26 | </div> | ||
27 | <div v-if="hasNoResults()" class="noresult">{{noresult}}</div> | 25 | <div v-if="hasNoResults()" class="noresult">{{noresult}}</div> |
28 | </div> | 26 | </div> |
29 | </template> | 27 | </template> |
diff --git a/viewer/src/store/galleryStore.ts b/viewer/src/store/galleryStore.ts index bc43ed2..4a5de0f 100644 --- a/viewer/src/store/galleryStore.ts +++ b/viewer/src/store/galleryStore.ts | |||
@@ -95,7 +95,15 @@ export default class GalleryStore extends VuexModule { | |||
95 | // Indexes the gallery | 95 | // Indexes the gallery |
96 | @action async indexTags() { | 96 | @action async indexTags() { |
97 | const root = this.galleryIndex?.tree ?? null; | 97 | const root = this.galleryIndex?.tree ?? null; |
98 | this.setTagsIndex(IndexFactory.generateTags(root)); | 98 | const index = IndexFactory.generateTags(root); |
99 | this.setTagsIndex(index); | ||
100 | return index; | ||
99 | } | 101 | } |
100 | 102 | ||
103 | // Searches for tags | ||
104 | @action async search(filters: string[]) { | ||
105 | const results = filters.flatMap(filter => IndexFactory.searchTags(this.tagsIndex, filter, true)); | ||
106 | this.setCurrentSearch(results); | ||
107 | return results; | ||
108 | } | ||
101 | } | 109 | } |
diff --git a/viewer/src/views/GallerySearch.vue b/viewer/src/views/GallerySearch.vue index e3369b3..e75a37e 100644 --- a/viewer/src/views/GallerySearch.vue +++ b/viewer/src/views/GallerySearch.vue | |||
@@ -39,6 +39,7 @@ export default class GalleryPicture extends Vue { | |||
39 | 39 | ||
40 | destroyed() { | 40 | destroyed() { |
41 | this.$uiStore.toggleSearchMode(false); | 41 | this.$uiStore.toggleSearchMode(false); |
42 | this.$galleryStore.setCurrentSearch([]); | ||
42 | } | 43 | } |
43 | 44 | ||
44 | items() { | 45 | items() { |
diff --git a/viewer/src/views/MainLayout.vue b/viewer/src/views/MainLayout.vue index 6ab7d9a..53917da 100644 --- a/viewer/src/views/MainLayout.vue +++ b/viewer/src/views/MainLayout.vue | |||
@@ -27,7 +27,7 @@ | |||
27 | <panel-left v-if="!isLoading" class="layout layout-left" /> | 27 | <panel-left v-if="!isLoading" class="layout layout-left" /> |
28 | <router-view v-if="!isLoading" ref="content" class="layout layout-content scrollbar" /> | 28 | <router-view v-if="!isLoading" ref="content" class="layout layout-content scrollbar" /> |
29 | <b-loading :active="isLoading" is-full-page /> | 29 | <b-loading :active="isLoading" is-full-page /> |
30 | <ld-key-press :keycode="27" @action="$uiStore.fullscreen=false" /> | 30 | <ld-key-press :keycode="27" @action="$uiStore.toggleFullscreen(false)" /> |
31 | </div> | 31 | </div> |
32 | </template> | 32 | </template> |
33 | 33 | ||
diff --git a/viewer/src/views/PanelLeft.vue b/viewer/src/views/PanelLeft.vue index 5b3196a..9e9a600 100644 --- a/viewer/src/views/PanelLeft.vue +++ b/viewer/src/views/PanelLeft.vue | |||
@@ -70,11 +70,7 @@ export default class PanelLeft extends Vue { | |||
70 | @Watch("$route") | 70 | @Watch("$route") |
71 | restoreSearchFilters(route: Route) { | 71 | restoreSearchFilters(route: Route) { |
72 | const query = Object.keys(route.query); | 72 | const query = Object.keys(route.query); |
73 | if (query.length > 0) { | 73 | if (query.length > 0) this.$galleryStore.search(query).then(search => (this.searchFilters = [...search])); |
74 | const tagsIndex = this.$galleryStore.tagsIndex; | ||
75 | this.searchFilters = Object.keys(route.query).flatMap(filter => IndexFactory.searchTags(tagsIndex, filter, true)); | ||
76 | this.$galleryStore.setCurrentSearch([...this.searchFilters]); | ||
77 | } | ||
78 | } | 74 | } |
79 | } | 75 | } |
80 | </script> | 76 | </script> |