diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-08-31 16:32:14 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-10-24 21:45:00 +0200 |
commit | f72ffa2f119f0b2644380e5c92f50dd2f05b6531 (patch) | |
tree | c368d59796f79ae2cf68de9e460edd3b8b984997 /apps/files/js/file-upload.js | |
parent | 786e858d23c4a476d5b8a24d3e7eed7d8c1b5eaf (diff) | |
download | nextcloud-server-f72ffa2f119f0b2644380e5c92f50dd2f05b6531.tar.gz nextcloud-server-f72ffa2f119f0b2644380e5c92f50dd2f05b6531.zip |
Fix js unit tests for webdav put upload changes
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/files/js/file-upload.js')
-rw-r--r-- | apps/files/js/file-upload.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index 3242ae7fa6b..b75505c5dfb 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -34,7 +34,12 @@ OC.FileUpload = function(uploader, data) { this.uploader = uploader; this.data = data; - var path = OC.joinPaths(this.uploader.fileList.getCurrentDirectory(), this.getFile().name); + var path = ''; + if (this.uploader.fileList) { + path = OC.joinPaths(this.uploader.fileList.getCurrentDirectory(), this.getFile().name); + } else { + path = this.getFile().name; + } this.id = 'web-file-upload-' + md5(path) + '-' + (new Date()).getTime(); }; OC.FileUpload.CONFLICT_MODE_DETECT = 0; @@ -364,6 +369,9 @@ OC.Uploader.prototype = _.extend({ * also see article @link http://blog.new-bamboo.co.uk/2012/01/10/ridiculously-simple-ajax-uploads-with-formdata */ _supportAjaxUploadWithProgress: function() { + if (window.TESTING) { + return true; + } return supportFileAPI() && supportAjaxUploadProgressEvents() && supportFormData(); // Is the File API supported? @@ -719,7 +727,6 @@ OC.Uploader.prototype = _.extend({ dropZone: options.dropZone, // restrict dropZone to content div autoUpload: false, sequentialUploads: true, - maxChunkSize: 10000000, //singleFileUploads is on by default, so the data.files array will always have length 1 /** * on first add of every selection @@ -920,7 +927,10 @@ OC.Uploader.prototype = _.extend({ // HTTP connection problem or other error OC.Notification.showTemporary(data.errorThrown, {timeout: 10}); } - upload.deleteUpload(); + + if (upload) { + upload.deleteUpload(); + } }, /** * called for every successful upload |