Commit a6c92de1 authored by asseldonk's avatar asseldonk
Browse files

filebrowser: only move files when source and destination path is unequal

parent e874aac0
......@@ -202,6 +202,7 @@ var FileBaseEvents = Class.extend({
event.preventDefault();
$(node).removeClass("file-dragover");
fileToBeMoved = (event.originalEvent.dataTransfer.getData('dataName'));
// if transfered data empty: upload
if (fileToBeMoved == "") {
if (data.type == "d") {
var path = self.FileBase.workflow.path + '/' + data.name;
......@@ -209,10 +210,14 @@ var FileBaseEvents = Class.extend({
var path = self.FileBase.workflow.path;
}
self.FileBase.actions.upload(path);
} else {
var source = self.FileBase.workflow.path + '/' + fileToBeMoved;
var destination = self.FileBase.workflow.path + '/' + data.name;
self.FileBase.actions.move(source, destination);
}
// if transfered data not empty: move
else {
if (data.type == "d") {
var source = self.FileBase.workflow.path + '/' + fileToBeMoved;
var destination = self.FileBase.workflow.path + '/' + data.name;
self.FileBase.actions.move(source, destination);
}
}
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment