aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
authorVincent Chan <plus.vincchan@gmail.com>2016-06-14 11:51:03 +0200
committerVincent Chan <plus.vincchan@gmail.com>2016-06-14 11:51:03 +0200
commit937d21ed29f29f424aaed7abb643a210ccb2453b (patch)
treea611f879900673978f120ac625582485819ebd1d /apps/files/js
parent864c3a8fbbe221d7ded83093a2e7c5bde097ef8c (diff)
downloadnextcloud-server-937d21ed29f29f424aaed7abb643a210ccb2453b.tar.gz
nextcloud-server-937d21ed29f29f424aaed7abb643a210ccb2453b.zip
properly fix folder upload to use delegatedEvent
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/filelist.js10
-rw-r--r--apps/files/js/jquery.fileupload.js6
2 files changed, 12 insertions, 4 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index f249f2d35c9..4b1c07b297e 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -2514,12 +2514,13 @@
var self = this;
// 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
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);
if (self.$el.hasClass('hidden')) {
@@ -2527,7 +2528,10 @@
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
if (dropTarget.length
&& !self.$el.is(dropTarget) // dropped on list directly
diff --git a/apps/files/js/jquery.fileupload.js b/apps/files/js/jquery.fileupload.js
index e9033437001..622161ede97 100644
--- a/apps/files/js/jquery.fileupload.js
+++ b/apps/files/js/jquery.fileupload.js
@@ -1267,7 +1267,11 @@
e.preventDefault();
this._getDroppedFiles(dataTransfer).always(function (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);
}
});