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:
Sean McArthur 2011-09-22 12:10:45 -05:00
Родитель e6013dfa86
Коммит 78a5b0c5d4
2 изменённых файлов: 2 добавлений и 5 удалений

Просмотреть файл

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