Fix drag and drop multiple files into a subdirectory didn't get all files to the right path

This commit is contained in:
Nathan Gray 2015-05-11 19:33:57 +00:00
parent 237d1d809e
commit 652cec5463
2 changed files with 9 additions and 4 deletions

View File

@ -452,9 +452,9 @@ var et2_file = et2_inputWidget.extend(
var file_count = this.resumable.files.length;
// Remove files from list
for(var i = 0; i < this.resumable.files.length; i++)
while(this.resumable.files.length > 0)
{
this.resumable.removeFile(this.resumable.files[i]);
this.resumable.removeFile(this.resumable.files[this.resumable.files.length -1]);
}
var event = jQuery.Event('upload');

View File

@ -830,12 +830,17 @@ app.classes.filemanager = AppJS.extend(
var widget = this.et2.getWidgetById('upload');
// Override finish to specify a potentially different path
var old_onfinish = widget.options.onFinishOne;
var old_onfinishone = widget.options.onFinishOne;
var old_onfinish = widget.options.onFinish;
widget.options.onFinishOne = function(_event, _file_count) {
widget.options.onFinishOne = old_onfinish;
self.upload(_event, _file_count, path);
};
widget.options.onFinish = function() {
widget.options.onFinish = old_onfinish;
widget.options.onFinishOne = old_onfinishone;
}
// This triggers the upload
widget.set_value(files);