From 370e3db3455f548699ff5e046e0f8dcc304991ac Mon Sep 17 00:00:00 2001
From: Zero~Informatique
Date: Fri, 14 Feb 2020 09:19:53 +0100
Subject: viewer: major code and search mode overhaul

Updated libraries to the lastest version
SCSS Formatter as suggested VSC extensions
Renamed toolbar-color by scrollbar-color
LD components use Props in favor of touching the stores directly (when possible)
Moved most common algorithms to a "services" folder
Complete search overhaul (lots of code change)
---
 viewer/src/components/LdCommand.vue | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

(limited to 'viewer/src/components/LdCommand.vue')

diff --git a/viewer/src/components/LdCommand.vue b/viewer/src/components/LdCommand.vue
index 7590ea7..468c241 100644
--- a/viewer/src/components/LdCommand.vue
+++ b/viewer/src/components/LdCommand.vue
@@ -23,14 +23,6 @@
     <a class="link" :title="$t('command.search')" @click="$uiStore.toggleFullWidth()">
       <fa-icon :icon="commandToggleSearchPanelIcon()" size="lg" />
     </a>
-    <router-link
-      to="/"
-      class="command-secondary"
-      :class="{'disabled': isRoot()}"
-      :title="$t('command.home')"
-    >
-      <fa-icon icon="home" size="lg" />
-    </router-link>
     <a class="link command-secondary" :title="$t('command.back')" @click="$router.go(-1)">
       <fa-icon icon="arrow-left" size="lg" />
     </a>
@@ -42,21 +34,23 @@
 </template>
 
 <script lang="ts">
-import { Component, Vue } from "vue-property-decorator";
+import { Component, Vue, Prop } from "vue-property-decorator";
 import { RawLocation } from "vue-router";
 
 @Component
 export default class LdCommand extends Vue {
+  @Prop({ required: true }) readonly currentItemPath!: Gallery.Item[];
+
   commandToggleSearchPanelIcon(): string {
     return this.$uiStore.fullWidth ? "search" : "angle-double-left";
   }
 
   isRoot(): boolean {
-    return this.$galleryStore.currentItemPath.length <= 1;
+    return this.currentItemPath.length <= 1;
   }
 
   parent(): RawLocation {
-    if (!this.isRoot()) return this.$galleryStore.currentItemPath[this.$galleryStore.currentItemPath.length - 2];
+    if (!this.isRoot()) return this.currentItemPath[this.currentItemPath.length - 2];
     return "";
   }
 }
-- 
cgit v1.2.3


From 1915fd6e8b7b0c83a9a1b9254fd945f1cc0c7c19 Mon Sep 17 00:00:00 2001
From: Zero~Informatique
Date: Sun, 23 Feb 2020 18:18:17 +0100
Subject: viewer: go to parent command fix when in search mode

Code review fix
---
 viewer/src/components/LdCommand.vue | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'viewer/src/components/LdCommand.vue')

diff --git a/viewer/src/components/LdCommand.vue b/viewer/src/components/LdCommand.vue
index 468c241..c0b86be 100644
--- a/viewer/src/components/LdCommand.vue
+++ b/viewer/src/components/LdCommand.vue
@@ -46,11 +46,12 @@ export default class LdCommand extends Vue {
   }
 
   isRoot(): boolean {
-    return this.currentItemPath.length <= 1;
+    return this.currentItemPath.length <= 1 && !this.$uiStore.searchMode;
   }
 
   parent(): RawLocation {
-    if (!this.isRoot()) return this.currentItemPath[this.currentItemPath.length - 2];
+    if (this.$uiStore.searchMode) return this.$route.path;
+    if (this.currentItemPath.length > 1) return this.currentItemPath[this.currentItemPath.length - 2];
     return "";
   }
 }
-- 
cgit v1.2.3

