Set Dropzone.js uploaders to have no time limit (#4878)

The upgrade to the latest Dropzone.js brought in a new `timeout` configuration variable, which defaults to 30s. This removes the time limit and restores original functionality.

Fixes #4869
This commit is contained in:
Ben Thomson 2020-01-15 06:47:25 +08:00 committed by Luke Towers
parent 0bbc12af45
commit c046466913
4 changed files with 4 additions and 1 deletions

View File

@ -104,6 +104,7 @@
previewsContainer: this.$filesContainer.get(0),
maxFiles: !this.options.isMulti ? 1 : null,
maxFilesize: this.options.maxFilesize,
timeout: 0,
headers: {}
}

View File

@ -276,7 +276,7 @@ this.scrollContentElement.insertBefore(this.selectionMarker,this.scrollContentEl
MediaManager.prototype.doObjectsCollide=function(aTop,aLeft,aWidth,aHeight,bTop,bLeft,bWidth,bHeight){return!(((aTop+aHeight)<(bTop))||(aTop>(bTop+bHeight))||((aLeft+aWidth)<bLeft)||(aLeft>(bLeft+bWidth)))}
MediaManager.prototype.initUploader=function(){if(!this.itemListElement||this.options.readOnly)
return
var uploaderOptions={clickable:this.$el.find('[data-control="upload"]').get(0),url:this.options.url,paramName:'file_data',headers:{},createImageThumbnails:false}
var uploaderOptions={clickable:this.$el.find('[data-control="upload"]').get(0),url:this.options.url,paramName:'file_data',timeout:0,headers:{},createImageThumbnails:false}
if(this.options.uniqueId){uploaderOptions.headers['X-OCTOBER-FILEUPLOAD']=this.options.uniqueId}
var token=$('meta[name="csrf-token"]').attr('content')
if(token){uploaderOptions.headers['X-CSRF-TOKEN']=token}

View File

@ -715,6 +715,7 @@
clickable: this.$el.find('[data-control="upload"]').get(0),
url: this.options.url,
paramName: 'file_data',
timeout: 0,
headers: {},
createImageThumbnails: false
// fallback: implement method that would set a flag that the uploader is not supported by the browser

View File

@ -150,6 +150,7 @@
paramName: 'file_data',
previewsContainer: $('<div />').get(0),
clickable: $link.get(0),
timeout: 0,
headers: {}
}