From 76af6cffce939ef3c9a0952e6f7adc234e92f782 Mon Sep 17 00:00:00 2001
From: Zero~Informatique
Date: Thu, 30 Jan 2020 17:04:09 +0100
Subject: viewer: directories first and sorted by title in the navigation mode

---
 viewer/src/views/GalleryDirectory.vue | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'viewer/src/views/GalleryDirectory.vue')

diff --git a/viewer/src/views/GalleryDirectory.vue b/viewer/src/views/GalleryDirectory.vue
index 1df0c4d..d01032d 100644
--- a/viewer/src/views/GalleryDirectory.vue
+++ b/viewer/src/views/GalleryDirectory.vue
@@ -19,7 +19,7 @@
 
 <template>
   <div class="thumbnail-tiles">
-    <div v-for="(item) in directory.properties.items" :key="item.path">
+    <div v-for="(item) in orderedItems" :key="item.path">
       <router-link :to="item.path">
         <gallery-thumbnail :item="item" />
       </router-link>
@@ -32,13 +32,19 @@
 
 <script lang="ts">
 import { Component, Vue, Prop } from "vue-property-decorator";
+import Tools from "@/tools";
 import GalleryThumbnail from "./GalleryThumbnail.vue";
+import Gallery from "./Gallery.vue";
 
 @Component({
   components: { GalleryThumbnail },
 })
 export default class GalleryDirectory extends Vue {
   @Prop({ required: true }) readonly directory!: Gallery.Directory;
+
+  get orderedItems() {
+    return Tools.directoriesFirst(this.directory.properties.items);
+  }
 }
 </script>
 
-- 
cgit v1.2.3

