Fix file drag and drop JS error

This commit is contained in:
Vincent Petry 2015-08-17 16:03:05 +02:00
parent 675d852c7d
commit 009c008ed8
2 changed files with 7 additions and 2 deletions

View file

@ -608,6 +608,7 @@
* Event handler when dropping on a breadcrumb
*/
_onDropOnBreadCrumb: function( event, ui ) {
var self = this;
var $target = $(event.target);
if (!$target.is('.crumb')) {
$target = $target.closest('.crumb');
@ -629,7 +630,9 @@
var files = this.getSelectedFiles();
if (files.length === 0) {
// single one selected without checkbox?
files = _.map(ui.helper.find('tr'), this.elementToFile);
files = _.map(ui.helper.find('tr'), function(el) {
return self.elementToFile($(el));
});
}
this.move(_.pluck(files, 'name'), targetPath);

View file

@ -453,7 +453,9 @@ var folderDropOptions = {
var files = FileList.getSelectedFiles();
if (files.length === 0) {
// single one selected without checkbox?
files = _.map(ui.helper.find('tr'), FileList.elementToFile);
files = _.map(ui.helper.find('tr'), function(el) {
return FileList.elementToFile($(el));
});
}
FileList.move(_.pluck(files, 'name'), targetPath);