aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/components/LdGallery.vue
diff options
context:
space:
mode:
authorZero~Informatique2020-09-11 00:15:04 +0200
committerG.Fouet2020-09-11 21:53:18 +0200
commite6c2a8d9653ffde924632ca2f260c3a8cddc14ed (patch)
treeccc847bdec26d131ee260203410d7a16a0a6fbcf /viewer/src/components/LdGallery.vue
parentd72e317896bcc2a675d21cec6f286e0b2730d77c (diff)
downloadldgallery-e6c2a8d9653ffde924632ca2f260c3a8cddc14ed.tar.gz
viewer: item display order
github: resolves #28
Diffstat (limited to 'viewer/src/components/LdGallery.vue')
-rw-r--r--viewer/src/components/LdGallery.vue6
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 }