diff options
Diffstat (limited to 'public/assets/js/_dependency-control/utils/getApis.js')
| -rw-r--r-- | public/assets/js/_dependency-control/utils/getApis.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/public/assets/js/_dependency-control/utils/getApis.js b/public/assets/js/_dependency-control/utils/getApis.js new file mode 100644 index 0000000..46788a6 --- /dev/null +++ b/public/assets/js/_dependency-control/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 |
