summaryrefslogtreecommitdiff
path: root/html/assets/js/utils/whenAll.js
blob: 8d1c3e27f28c5b22f89e19320832fa5310c82e83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
define(function () {
    return function (deferreds) {
        return $.Deferred(function (def) {
            $.when.apply(jQuery, deferreds).then(
                function () {
                    def.resolveWith(this, [Array.prototype.slice.call(arguments)]);
                },
                function () {
                    def.rejectWith(this, [Array.prototype.slice.call(arguments)]);
                });
        });
    };
});