summaryrefslogtreecommitdiff
path: root/public/assets/js/_dependency-control/utils/whenAll.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets/js/_dependency-control/utils/whenAll.js')
-rw-r--r--public/assets/js/_dependency-control/utils/whenAll.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/public/assets/js/_dependency-control/utils/whenAll.js b/public/assets/js/_dependency-control/utils/whenAll.js
new file mode 100644
index 0000000..8d1c3e2
--- /dev/null
+++ b/public/assets/js/_dependency-control/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)]);
+ });
+ });
+ };
+});