diff options
Diffstat (limited to 'viewer/src/components/LdGallery.vue')
-rw-r--r-- | viewer/src/components/LdGallery.vue | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/viewer/src/components/LdGallery.vue b/viewer/src/components/LdGallery.vue index 5a72d99..0c0a43c 100644 --- a/viewer/src/components/LdGallery.vue +++ b/viewer/src/components/LdGallery.vue | |||
@@ -20,7 +20,7 @@ | |||
20 | <template> | 20 | <template> |
21 | <ld-error v-if="hasNoResults" icon="search" :message="noresult" /> | 21 | <ld-error v-if="hasNoResults" icon="search" :message="noresult" /> |
22 | <div v-else class="thumbnail-tiles"> | 22 | <div v-else class="thumbnail-tiles"> |
23 | <router-link v-for="item in items" :key="item.path" :to="item.path"> | 23 | <router-link v-for="item in sortedItems" :key="item.path" :to="item.path"> |
24 | <ld-thumbnail :item="item" /> | 24 | <ld-thumbnail :item="item" /> |
25 | </router-link> | 25 | </router-link> |
26 | </div> | 26 | </div> |
@@ -35,6 +35,10 @@ export default class LdPicture extends Vue { | |||
35 | @Prop({ type: Array, required: true }) readonly items!: Gallery.Item[]; | 35 | @Prop({ type: Array, required: true }) readonly items!: Gallery.Item[]; |
36 | @Prop(String) readonly noresult?: string; | 36 | @Prop(String) readonly noresult?: string; |
37 | 37 | ||
38 | get sortedItems() { | ||
39 | return this.items.sort(this.$uiStore.sortFn); | ||
40 | } | ||
41 | |||
38 | get hasNoResults(): boolean { | 42 | get hasNoResults(): boolean { |
39 | return Boolean(this.noresult) && this.items.length === 0; | 43 | return Boolean(this.noresult) && this.items.length === 0; |
40 | } | 44 | } |