app/assets/javascripts/tessa.esm.js in tessa-1.0.0.pre.rc2 vs app/assets/javascripts/tessa.esm.js in tessa-1.0.0.pre.rc3

- old
+ new

@@ -466,19 +466,14 @@ Dropzone.autoDiscover = false; window.WCC.Dropzone = class Dropzone extends window.Dropzone { uploadFile(file) { - var handleError, headerName, headerValue, headers, progressObj, ref, ref1, response, updateProgress, xhr; + var handleError, headerName, headerValue, headers, progressObj, ref, response, updateProgress, xhr; xhr = new XMLHttpRequest; file.xhr = xhr; xhr.open(file.uploadMethod, file.uploadURL, true); - ref = file.uploadHeaders; - for (headerName in ref) { - headerValue = ref[headerName]; - xhr.setRequestHeader(headerName, headerValue); - } response = null; handleError = () => this._errorProcessing([ file ], response || this.options.dictResponseError.replace("{{statusCode}}", xhr.status), xhr); updateProgress = e => { var allFilesFinished, progress; if (e != null) { @@ -501,11 +496,11 @@ } } return this.emit("uploadprogress", file, progress, file.upload.bytesSent); }; xhr.onload = e => { - var ref1; + var ref; if (file.status === WCC.Dropzone.CANCELED) { return; } if (xhr.readyState !== 4) { return; @@ -518,11 +513,11 @@ e = error1; response = "Invalid JSON response from server."; } } updateProgress(); - if (!(200 <= (ref1 = xhr.status) && ref1 < 300)) { + if (!(200 <= (ref = xhr.status) && ref < 300)) { return handleError(); } else { return this._finished([ file ], response, e); } }; @@ -530,18 +525,21 @@ if (file.status === WCC.Dropzone.CANCELED) { return; } return handleError(); }; - progressObj = (ref1 = xhr.upload) != null ? ref1 : xhr; + progressObj = (ref = xhr.upload) != null ? ref : xhr; progressObj.onprogress = updateProgress; headers = { Accept: "application/json", "Cache-Control": "no-cache", "X-Requested-With": "XMLHttpRequest" }; if (this.options.headers) { - extend(headers, this.options.headers); + $.extend(headers, this.options.headers); + } + if (file.uploadHeaders) { + $.extend(headers, file.uploadHeaders); } for (headerName in headers) { headerValue = headers[headerName]; xhr.setRequestHeader(headerName, headerValue); }