18 lines
381 B
JavaScript
18 lines
381 B
JavaScript
if ($.when.all === undefined)
|
|
{
|
|
$.when.all = function(deferreds)
|
|
{
|
|
var deferred = new $.Deferred();
|
|
$.when.apply($, deferreds).then(function()
|
|
{
|
|
console.log(arguments);
|
|
deferred.resolve(Array.prototype.slice.call(arguments, 0));
|
|
}, function()
|
|
{
|
|
console.log(arguments);
|
|
deferred.fail(Array.prototype.slice.call(arguments, 0));
|
|
});
|
|
|
|
return deferred;
|
|
}
|
|
}
|