Skip to content

Commit f54eef7

Browse files
authored
Merge pull request alexusmai#18 from lkloon123/develop
Enhanced UX
2 parents e8f9be1 + 5417fba commit f54eef7

File tree

4 files changed

+31
-4
lines changed

4 files changed

+31
-4
lines changed

src/components/blocks/Navbar.vue

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,30 @@
3636
disabled
3737
v-if="uploading"
3838
v-bind:title="lang.btn.upload">
39-
<i class="fas fa-download"></i>
39+
<i class="fas fa-upload"></i>
4040
</button>
4141
<button type="button" class="btn btn-secondary"
4242
v-else
4343
v-on:click="showModal('Upload')"
4444
v-bind:title="lang.btn.upload">
45-
<i class="fas fa-download"></i>
45+
<i class="fas fa-upload"></i>
4646
</button>
4747
<button type="button" class="btn btn-secondary"
48+
v-bind:disabled="!isAnyItemSelected"
4849
v-on:click="showModal('Delete')"
4950
v-bind:title="lang.btn.delete">
5051
<i class="fas fa-trash-alt"></i>
5152
</button>
5253
</div>
5354
<div class="btn-group" role="group">
5455
<button type="button" class="btn btn-secondary"
56+
v-bind:disabled="!isAnyItemSelected"
5557
v-bind:title="lang.btn.copy"
5658
v-on:click="toClipboard('copy')">
5759
<i class="fas fa-copy"></i>
5860
</button>
5961
<button type="button" class="btn btn-secondary"
62+
v-bind:disabled="!isAnyItemSelected"
6063
v-bind:title="lang.btn.cut"
6164
v-on:click="toClipboard('cut')">
6265
<i class="fas fa-cut"></i>
@@ -106,6 +109,7 @@
106109

107110
<script>
108111
import translate from './../../mixins/translate';
112+
import EventBus from './../../eventBus';
109113
110114
export default {
111115
mixins: [translate],
@@ -135,6 +139,15 @@ export default {
135139
this.$store.state.fm[this.activeManager].history.length - 1;
136140
},
137141
142+
/**
143+
* Is any files or directories selected?
144+
* @returns {boolean}
145+
*/
146+
isAnyItemSelected() {
147+
return this.$store.state.fm[this.activeManager].selected.files.length > 0 ||
148+
this.$store.state.fm[this.activeManager].selected.directories.length > 0;
149+
},
150+
138151
/**
139152
* Manager view type - grid or table
140153
* @returns {default.computed.viewType|(function())|string}
@@ -195,6 +208,13 @@ export default {
195208
*/
196209
toClipboard(type) {
197210
this.$store.dispatch('fm/toClipboard', type);
211+
212+
// show notification
213+
if(type === 'cut') {
214+
EventBus.$emit('addNotification', {status: 'success', message: 'Cut to clipboard!'});
215+
} else if(type === 'copy') {
216+
EventBus.$emit('addNotification', {status: 'success', message: 'Copied to clipboard!'});
217+
}
198218
},
199219
200220
/**

src/components/manager/GridView.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="fm-grid">
33
<div class="d-flex align-content-start flex-wrap">
4-
<div class="fm-grid-item text-center" v-on:click="levelUp">
4+
<div class="fm-grid-item text-center" v-on:click="levelUp" v-if="!isRootPath">
55
<div class="fm-item-icon">
66
<i class="fas fa-level-up-alt fa-5x pb-2"></i>
77
</div>

src/components/manager/TableView.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
</tr>
4343
</thead>
4444
<tbody>
45-
<tr>
45+
<tr v-if="!isRootPath">
4646
<td colspan="4" class="fm-content-item" v-on:click="levelUp">
4747
<i class="fas fa-level-up-alt"></i>
4848
</td>

src/components/manager/mixins/manager.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ export default {
4949
acl() {
5050
return this.$store.state.fm.settings.acl;
5151
},
52+
53+
/**
54+
* Check if current path is at root level
55+
*/
56+
isRootPath() {
57+
return this.$store.state.fm[this.manager].selectedDirectory === null;
58+
}
5259
},
5360
methods: {
5461
/**

0 commit comments

Comments
 (0)