diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index 050c333793c0..cae1dbdd1481 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -251,6 +251,7 @@ OC.FileUpload.prototype = { this.data.headers['Authorization'] = 'Basic ' + btoa(userName + ':' + (password || '')); } + this.data.headers['requesttoken'] = OC.requestToken; var chunkFolderPromise; if ($.support.blobSlice @@ -1195,11 +1196,15 @@ OC.Uploader.prototype = _.extend({ fileupload.on('fileuploaddone', function(e, data) { var upload = self.getUpload(data); upload.done().then(function() { - // don't hide if there are more files to process - if (!self.isProcessing()) { - self._hideProgressBar(); - } self.trigger('done', e, upload); + // defer because sometimes the current upload is still in pending + // state but frees itself afterwards + _.defer(function() { + // don't hide if there are more files to process + if (!self.isProcessing()) { + self._hideProgressBar(); + } + }); }).fail(function(status, response) { var message = response.message; self._hideProgressBar(); diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 94368c712937..defb4f5b6f40 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -2702,7 +2702,7 @@ return false; } - var dropTarget = $(e.originalEvent.target); + var dropTarget = $(e.originalEvent.delegatedEvent.target); // 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/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js index e7b0adf2f861..2f6c151f7c1d 100644 --- a/apps/files/tests/js/filelistSpec.js +++ b/apps/files/tests/js/filelistSpec.js @@ -2649,7 +2649,9 @@ describe('OCA.Files.FileList tests', function() { function dropOn($target, data) { var eventData = { originalEvent: { - target: $target + delegatedEvent: { + target: $target + } } }; uploader.trigger('drop', eventData, data || {});