Pony.fm/app/scripts/shared/jquery-extensions.js
2015-04-23 04:17:05 -05:00

14 lines
No EOL
344 B
JavaScript

if (jQuery.when.all===undefined) {
jQuery.when.all = function(deferreds) {
var deferred = new jQuery.Deferred();
$.when.apply(jQuery, deferreds).then(
function() {
deferred.resolve(Array.prototype.slice.call(arguments));
},
function() {
deferred.fail(Array.prototype.slice.call(arguments));
});
return deferred;
}
}