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-19 19:50:52 +00:00
parent 65adf87c4e
commit a6ba6ab17e
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; var file_count = this.resumable.files.length;
// Remove files from list // 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'); var event = jQuery.Event('upload');

View File

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