diff options
author | pacien | 2020-09-25 16:01:49 +0200 |
---|---|---|
committer | pacien | 2020-09-25 16:01:49 +0200 |
commit | e93f7b1eb84c083d67567115284c0002a3a7d5fc (patch) | |
tree | 8d373e8f7f571485e1330928f43b090ed004c525 /viewer/src/views/GallerySearch.vue | |
parent | 8e3ac8fe44bebb38e1882ca7f06b8100078ad88d (diff) | |
parent | fd542f75a1d94ee5f804d0925823276b97f38581 (diff) | |
download | ldgallery-e93f7b1eb84c083d67567115284c0002a3a7d5fc.tar.gz |
Merge branch 'develop' for release v2.0v2.0
Diffstat (limited to 'viewer/src/views/GallerySearch.vue')
-rw-r--r-- | viewer/src/views/GallerySearch.vue | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/viewer/src/views/GallerySearch.vue b/viewer/src/views/GallerySearch.vue index e75a37e..fec7216 100644 --- a/viewer/src/views/GallerySearch.vue +++ b/viewer/src/views/GallerySearch.vue | |||
@@ -18,7 +18,7 @@ | |||
18 | --> | 18 | --> |
19 | 19 | ||
20 | <template> | 20 | <template> |
21 | <ld-gallery :items="items()" :noresult="noResult()" /> | 21 | <ld-gallery :items="items" :noresult="noResult" /> |
22 | </template> | 22 | </template> |
23 | 23 | ||
24 | <script lang="ts"> | 24 | <script lang="ts"> |
@@ -29,8 +29,7 @@ import IndexSearch from "@/services/indexsearch"; | |||
29 | @Component | 29 | @Component |
30 | export default class GalleryPicture extends Vue { | 30 | export default class GalleryPicture extends Vue { |
31 | @Prop(String) readonly path!: string; | 31 | @Prop(String) readonly path!: string; |
32 | 32 | otherCount: number = 0; | |
33 | otherCount: Number = 0; | ||
34 | 33 | ||
35 | mounted() { | 34 | mounted() { |
36 | this.$uiStore.toggleFullscreen(false); | 35 | this.$uiStore.toggleFullscreen(false); |
@@ -42,19 +41,17 @@ export default class GalleryPicture extends Vue { | |||
42 | this.$galleryStore.setCurrentSearch([]); | 41 | this.$galleryStore.setCurrentSearch([]); |
43 | } | 42 | } |
44 | 43 | ||
45 | items() { | 44 | get items() { |
46 | const searchResult = IndexSearch.search(this.$galleryStore.currentSearch); | 45 | const searchResult = IndexSearch.search(this.$galleryStore.currentSearch); |
47 | const filteredByPath = searchResult.filter(item => item.path.startsWith(this.path)); | 46 | const filteredByPath = searchResult.filter(item => item.path.startsWith(this.path)); |
48 | this.otherCount = searchResult.length - filteredByPath.length; | 47 | this.otherCount = searchResult.length - filteredByPath.length; |
49 | return filteredByPath; | 48 | return filteredByPath; |
50 | } | 49 | } |
51 | 50 | ||
52 | noResult() { | 51 | get noResult() { |
53 | const params = [this.otherCount, this.otherCount > 1 ? "s" : ""]; | 52 | return this.$tc("search.no-result-fmt", this.otherCount, [this.otherCount]); |
54 | return this.$t("search.no-results.otherfolders", params); | ||
55 | } | 53 | } |
56 | } | 54 | } |
57 | </script> | 55 | </script> |
58 | 56 | ||
59 | <style lang="scss"> | 57 | <style lang="scss"></style> |
60 | </style> | ||