aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/views/PanelTop.vue
diff options
context:
space:
mode:
Diffstat (limited to 'viewer/src/views/PanelTop.vue')
-rw-r--r--viewer/src/views/PanelTop.vue64
1 files changed, 8 insertions, 56 deletions
diff --git a/viewer/src/views/PanelTop.vue b/viewer/src/views/PanelTop.vue
index 0efc9b6..0591f37 100644
--- a/viewer/src/views/PanelTop.vue
+++ b/viewer/src/views/PanelTop.vue
@@ -18,69 +18,21 @@
18--> 18-->
19 19
20<template> 20<template>
21 <div v-if="isReady"> 21 <div class="flex">
22 <b-steps 22 <ld-command :current-item-path="$galleryStore.currentItemPath" />
23 v-model="activeStep" 23 <ld-breadcrumb
24 class="pathBreadcrumb" 24 :current-item-path="$galleryStore.currentItemPath"
25 type="is-info" 25 :search-mode="$uiStore.searchMode"
26 :has-navigation="false" 26 />
27 :animated="false"
28 @input="onStepClick"
29 >
30 <b-step-item
31 v-for="item in $galleryStore.currentItemPath"
32 :key="item.path"
33 :label="item.title"
34 :icon="getIcon(item)"
35 :to="item.path"
36 />
37 </b-steps>
38 </div> 27 </div>
39</template> 28</template>
40 29
41<script lang="ts"> 30<script lang="ts">
42import { Component, Vue, Prop, Watch } from "vue-property-decorator"; 31import { Component, Vue } from "vue-property-decorator";
43import Gallery from "./Gallery.vue";
44 32
45@Component 33@Component
46export default class PanelTop extends Vue { 34export default class PanelTop extends Vue {}
47 activeStep: number = -1;
48
49 mounted() {
50 this.currentItemPathChanged();
51 }
52
53 get isReady() {
54 return this.activeStep >= 0;
55 }
56
57 @Watch("$galleryStore.currentItemPath")
58 currentItemPathChanged() {
59 this.activeStep = -1;
60 this.$nextTick(() => (this.activeStep = this.$galleryStore.currentItemPath.length - 1));
61 }
62
63 getIcon(item: Gallery.Item) {
64 switch (item.properties.type) {
65 case "picture":
66 return "image";
67 case "directory":
68 return "folder";
69 }
70 }
71
72 onStepClick(index: number) {
73 const item = this.$galleryStore.currentItemPath[index];
74 if (item) this.$router.push(item.path);
75 }
76}
77</script> 35</script>
78 36
79<style lang="scss"> 37<style lang="scss">
80.pathBreadcrumb {
81 margin: 3px;
82}
83.step-title {
84 color: white;
85}
86</style> 38</style>