From d604501974c06b11572ac99b9be98154f3089ab8 Mon Sep 17 00:00:00 2001 From: benweet Date: Sat, 24 Mar 2018 17:03:35 +0000 Subject: [PATCH] Fixed explorer drag and drop in firefox --- src/components/Explorer.vue | 2 +- src/components/ExplorerNode.vue | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/Explorer.vue b/src/components/Explorer.vue index cbfee601..ec8ff0d5 100644 --- a/src/components/Explorer.vue +++ b/src/components/Explorer.vue @@ -55,7 +55,7 @@ export default { ]), editItem() { const node = this.selectedNode; - if (!node.isTrash) { + if (!node.isTrash && !node.isTemp) { this.$store.commit('explorer/setEditingId', node.item.id); } }, diff --git a/src/components/ExplorerNode.vue b/src/components/ExplorerNode.vue index ee354627..8ddaa19e 100644 --- a/src/components/ExplorerNode.vue +++ b/src/components/ExplorerNode.vue @@ -134,6 +134,9 @@ export default { return; } this.$store.commit('explorer/setDragSourceId', this.node.item.id); + // Fix for Firefox + // See https://stackoverflow.com/a/3977637/1333165 + evt.dataTransfer.setData('Text', this.node.item.id); }, onDrop() { const sourceNode = this.$store.getters['explorer/dragSourceNode']; @@ -175,7 +178,7 @@ export default { type: 'separator', }, { name: 'Rename', - disabled: this.node.isTrash, + disabled: this.node.isTrash || this.node.isTemp, perform: () => this.setEditingId(this.node.item.id), }, { name: 'Delete',