summaryrefslogtreecommitdiff
path: root/html/content/js/Utils/getApis.js
diff options
context:
space:
mode:
Diffstat (limited to 'html/content/js/Utils/getApis.js')
-rw-r--r--html/content/js/Utils/getApis.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/html/content/js/Utils/getApis.js b/html/content/js/Utils/getApis.js
new file mode 100644
index 0000000..46788a6
--- /dev/null
+++ b/html/content/js/Utils/getApis.js
@@ -0,0 +1,17 @@
+define(['apiReady', 'whenAll'], function (apiReady, whenAll) {
+ return function ($elements, name) {
+ var result = [];
+ var d = $.Deferred();
+ var p = $elements.map(function () {
+ var $element = $(this);
+ return apiReady($element, name).then(function (api) {
+ result.push({ api: api, $element: $element });
+ });
+ });
+ whenAll(p).then(function () {
+ d.resolve(result);
+ });
+
+ return d;
+ };
+}); \ No newline at end of file