aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/components/LdCommand.vue
diff options
context:
space:
mode:
Diffstat (limited to 'viewer/src/components/LdCommand.vue')
-rw-r--r--viewer/src/components/LdCommand.vue97
1 files changed, 0 insertions, 97 deletions
diff --git a/viewer/src/components/LdCommand.vue b/viewer/src/components/LdCommand.vue
deleted file mode 100644
index 6059162..0000000
--- a/viewer/src/components/LdCommand.vue
+++ /dev/null
@@ -1,97 +0,0 @@
1<!-- ldgallery - A static generator which turns a collection of tagged
2-- pictures into a searchable web gallery.
3--
4-- Copyright (C) 2019-2020 Guillaume FOUET
5-- 2020 Pacien TRAN-GIRARD
6--
7-- This program is free software: you can redistribute it and/or modify
8-- it under the terms of the GNU Affero General Public License as
9-- published by the Free Software Foundation, either version 3 of the
10-- License, or (at your option) any later version.
11--
12-- This program is distributed in the hope that it will be useful,
13-- but WITHOUT ANY WARRANTY; without even the implied warranty of
14-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15-- GNU Affero General Public License for more details.
16--
17-- You should have received a copy of the GNU Affero General Public License
18-- along with this program. If not, see <https://www.gnu.org/licenses/>.
19-->
20
21<template>
22 <div class="flex command-btns">
23 <a class="link" :title="$t('command.search')" @click="$uiStore.toggleFullWidth()">
24 <fa-icon :icon="commandToggleSearchPanelIcon" size="lg" />
25 </a>
26 <ld-command-sort />
27 <a
28 :class="{ disabled: isEntryPoint }"
29 class="link command-secondary"
30 :title="$t('command.back')"
31 @click="isEntryPoint || $router.back()"
32 >
33 <fa-icon icon="arrow-left" size="lg" />
34 </a>
35 <router-link :class="{ disabled: isRoot }" :title="$t('command.parent')" :to="parent">
36 <fa-icon icon="folder" size="xs" />
37 <fa-icon icon="level-up-alt" size="lg" />
38 </router-link>
39 </div>
40</template>
41
42<script lang="ts">
43import { Component, Vue, Prop } from "vue-property-decorator";
44import { RawLocation } from "vue-router";
45
46@Component
47export default class LdCommand extends Vue {
48 @Prop({ type: Array, required: true }) readonly currentItemPath!: Gallery.Item[];
49
50 get commandToggleSearchPanelIcon(): string {
51 return this.$uiStore.fullWidth ? "search" : "angle-double-left";
52 }
53
54 get isRoot(): boolean {
55 return this.currentItemPath.length <= 1 && !this.$uiStore.searchMode;
56 }
57
58 get isEntryPoint(): boolean {
59 return history.state?.ldgallery === "ENTRYPOINT"; // Set by MainLayout.vue
60 }
61
62 get parent(): RawLocation {
63 if (this.$uiStore.searchMode) return this.$route.path;
64 if (this.currentItemPath.length > 1) return this.currentItemPath[this.currentItemPath.length - 2];
65 return "";
66 }
67}
68</script>
69
70<style lang="scss">
71@import "~@/assets/scss/_buefy_variables.scss";
72@import "~@/assets/scss/theme.scss";
73
74.command-btns {
75 background-color: $command-buttons-bgcolor;
76 justify-content: space-around;
77 vertical-align: middle;
78 align-items: center;
79 flex: 0 0 $layout-left;
80
81 > a {
82 // normalise icon active boxes
83 width: $layout-top;
84 line-height: $layout-top;
85 text-align: center;
86 vertical-align: middle;
87 }
88
89 @media only screen and (max-width: $tablet) {
90 flex: 0 1;
91
92 > .command-secondary {
93 display: none;
94 }
95 }
96}
97</style>