vendor/assets/javascripts/cloudinary/jquery.fileupload-process.js in cloudinary-1.0.78 vs vendor/assets/javascripts/cloudinary/jquery.fileupload-process.js in cloudinary-1.0.79

- old
+ new

@@ -1,18 +1,18 @@ /* - * jQuery File Upload Processing Plugin 1.2.2 + * jQuery File Upload Processing Plugin 1.3.0 * https://github.com/blueimp/jQuery-File-Upload * * Copyright 2012, Sebastian Tschan * https://blueimp.net * * Licensed under the MIT license: * http://www.opensource.org/licenses/MIT */ -/*jslint nomen: true, unparam: true */ -/*global define, window */ +/* jshint nomen:false */ +/* global define, window */ (function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { // Register as an anonymous AMD module: @@ -62,17 +62,21 @@ ); } */ }, - _processFile: function (data) { + _processFile: function (data, originalData) { var that = this, dfd = $.Deferred().resolveWith(that, [data]), chain = dfd.promise(); this._trigger('process', null, data); $.each(data.processQueue, function (i, settings) { var func = function (data) { + if (originalData.errorThrown) { + return $.Deferred() + .rejectWith(that, [originalData]).promise(); + } return that.processActions[settings.action].call( that, data, settings ); @@ -134,10 +138,14 @@ this._trigger('processstart'); } $.each(data.files, function (index) { var opts = index ? $.extend({}, options) : options, func = function () { - return that._processFile(opts); + if (data.errorThrown) { + return $.Deferred() + .rejectWith(that, [data]).promise(); + } + return that._processFile(opts, data); }; opts.index = index; that._processing += 1; that._processingQueue = that._processingQueue.pipe(func, func) .always(function () {