зеркало из https://github.com/mozilla/FlightDeck.git
correctly dont insert a duplicate File is already is in tree
fixes Bug 688319 - Dragging a file into a folder in the Data directory duplicates the file in the UI
This commit is contained in:
Родитель
e6013dfa86
Коммит
78a5b0c5d4
|
@ -590,6 +590,7 @@ var Attachment = new Class({
|
|||
delete packAttachments[oldUID];
|
||||
|
||||
this.setOptions(options);
|
||||
this.options.path = options.filename + '.' + options.type;
|
||||
packAttachments[options.uid] = this;
|
||||
|
||||
var editorUID = this.getEditorID();
|
||||
|
@ -1071,7 +1072,7 @@ Package.Edit = new Class({
|
|||
filename = filename.getFileName();
|
||||
}
|
||||
|
||||
var attachmentEl = fd.sidebar.getBranchFromFile(newName, 'data');
|
||||
var attachmentEl = fd.sidebar.getBranchFromPath(newName, 'data');
|
||||
var spinnerEl = attachmentEl || $(fd.sidebar.trees.data);
|
||||
|
||||
new Request.JSON({
|
||||
|
|
|
@ -229,7 +229,6 @@ var Sidebar = new Class({
|
|||
options.nodrag = true;
|
||||
}
|
||||
|
||||
|
||||
var element = tree.addPath(file, options);
|
||||
tree.collapse.prepare();
|
||||
|
||||
|
@ -271,8 +270,6 @@ var Sidebar = new Class({
|
|||
},
|
||||
|
||||
removeFile: function(file, prefix) {
|
||||
$log('sidebar destroy')
|
||||
|
||||
if (file instanceof File) {
|
||||
file.destroy();
|
||||
return;
|
||||
|
@ -418,7 +415,6 @@ var Sidebar = new Class({
|
|||
} else if (fileType == Module) {
|
||||
fd.getItem().removeModules(file);
|
||||
} else if (fileType == Attachment) {
|
||||
$log('removing folder')
|
||||
fd.getItem().removeAttachments(file);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче