properly fix folder upload to use delegatedEvent
This commit is contained in:
parent
864c3a8fbb
commit
937d21ed29
|
@ -2514,12 +2514,13 @@
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
// handle upload events
|
// handle upload events
|
||||||
var fileUploadStart = this.$el.find('#file_upload_start');
|
var fileUploadStart = this.$el;
|
||||||
|
var delegatedElement = '#file_upload_start';
|
||||||
|
|
||||||
// detect the progress bar resize
|
// detect the progress bar resize
|
||||||
fileUploadStart.on('resized', this._onResize);
|
fileUploadStart.on('resized', this._onResize);
|
||||||
|
|
||||||
fileUploadStart.on('fileuploaddrop', function(e, data) {
|
fileUploadStart.on('fileuploaddrop', delegatedElement, function(e, data) {
|
||||||
OC.Upload.log('filelist handle fileuploaddrop', e, data);
|
OC.Upload.log('filelist handle fileuploaddrop', e, data);
|
||||||
|
|
||||||
if (self.$el.hasClass('hidden')) {
|
if (self.$el.hasClass('hidden')) {
|
||||||
|
@ -2527,7 +2528,10 @@
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var dropTarget = $(e.originalEvent.target);
|
console.log(e);
|
||||||
|
var dropTarget = $(e.delegatedEvent.target);
|
||||||
|
console.log(dropTarget);
|
||||||
|
|
||||||
// check if dropped inside this container and not another one
|
// check if dropped inside this container and not another one
|
||||||
if (dropTarget.length
|
if (dropTarget.length
|
||||||
&& !self.$el.is(dropTarget) // dropped on list directly
|
&& !self.$el.is(dropTarget) // dropped on list directly
|
||||||
|
|
|
@ -1267,7 +1267,11 @@
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this._getDroppedFiles(dataTransfer).always(function (files) {
|
this._getDroppedFiles(dataTransfer).always(function (files) {
|
||||||
data.files = files;
|
data.files = files;
|
||||||
if (that._trigger('drop', e, data) !== false) {
|
if (that._trigger(
|
||||||
|
'drop',
|
||||||
|
$.Event('drop', {delegatedEvent: e}),
|
||||||
|
data
|
||||||
|
) !== false) {
|
||||||
that._onAdd(e, data);
|
that._onAdd(e, data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue