diff options
Diffstat (limited to 'html/content/js/Utils/whenAll.js')
| -rw-r--r-- | html/content/js/Utils/whenAll.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/html/content/js/Utils/whenAll.js b/html/content/js/Utils/whenAll.js new file mode 100644 index 0000000..8d1c3e2 --- /dev/null +++ b/html/content/js/Utils/whenAll.js @@ -0,0 +1,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)]);
+ });
+ });
+ };
+});
|
