Fixed explorer drag and drop in firefox

This commit is contained in:
benweet 2018-03-24 17:03:35 +00:00
parent 5973a0acc6
commit d604501974
2 changed files with 5 additions and 2 deletions

View File

@ -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);
}
},

View File

@ -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',