|
36 | 36 | disabled
|
37 | 37 | v-if="uploading"
|
38 | 38 | v-bind:title="lang.btn.upload">
|
39 |
| - <i class="fas fa-download"></i> |
| 39 | + <i class="fas fa-upload"></i> |
40 | 40 | </button>
|
41 | 41 | <button type="button" class="btn btn-secondary"
|
42 | 42 | v-else
|
43 | 43 | v-on:click="showModal('Upload')"
|
44 | 44 | v-bind:title="lang.btn.upload">
|
45 |
| - <i class="fas fa-download"></i> |
| 45 | + <i class="fas fa-upload"></i> |
46 | 46 | </button>
|
47 | 47 | <button type="button" class="btn btn-secondary"
|
| 48 | + v-bind:disabled="!isAnyItemSelected" |
48 | 49 | v-on:click="showModal('Delete')"
|
49 | 50 | v-bind:title="lang.btn.delete">
|
50 | 51 | <i class="fas fa-trash-alt"></i>
|
51 | 52 | </button>
|
52 | 53 | </div>
|
53 | 54 | <div class="btn-group" role="group">
|
54 | 55 | <button type="button" class="btn btn-secondary"
|
| 56 | + v-bind:disabled="!isAnyItemSelected" |
55 | 57 | v-bind:title="lang.btn.copy"
|
56 | 58 | v-on:click="toClipboard('copy')">
|
57 | 59 | <i class="fas fa-copy"></i>
|
58 | 60 | </button>
|
59 | 61 | <button type="button" class="btn btn-secondary"
|
| 62 | + v-bind:disabled="!isAnyItemSelected" |
60 | 63 | v-bind:title="lang.btn.cut"
|
61 | 64 | v-on:click="toClipboard('cut')">
|
62 | 65 | <i class="fas fa-cut"></i>
|
|
106 | 109 |
|
107 | 110 | <script>
|
108 | 111 | import translate from './../../mixins/translate';
|
| 112 | +import EventBus from './../../eventBus'; |
109 | 113 |
|
110 | 114 | export default {
|
111 | 115 | mixins: [translate],
|
@@ -135,6 +139,15 @@ export default {
|
135 | 139 | this.$store.state.fm[this.activeManager].history.length - 1;
|
136 | 140 | },
|
137 | 141 |
|
| 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 | +
|
138 | 151 | /**
|
139 | 152 | * Manager view type - grid or table
|
140 | 153 | * @returns {default.computed.viewType|(function())|string}
|
@@ -195,6 +208,13 @@ export default {
|
195 | 208 | */
|
196 | 209 | toClipboard(type) {
|
197 | 210 | 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 | + } |
198 | 218 | },
|
199 | 219 |
|
200 | 220 | /**
|
|
0 commit comments