mirror of
https://github.com/nasa/openmct.git
synced 2024-12-19 05:07:52 +00:00
[API] Fix paths for legacyRegistry
This commit is contained in:
parent
a39e8e44f0
commit
b87dd5def6
@ -60,7 +60,8 @@ define(
|
||||
*/
|
||||
BundleLoader.prototype.loadBundles = function (bundles) {
|
||||
var $http = this.$http,
|
||||
$log = this.$log;
|
||||
$log = this.$log,
|
||||
legacyRegistry = this.legacyRegistry;
|
||||
|
||||
// Utility function; load contents of JSON file using $http
|
||||
function getJSON(file) {
|
||||
@ -97,10 +98,10 @@ define(
|
||||
// Load an individual bundle, as a Bundle object.
|
||||
// Returns undefined if the definition could not be loaded.
|
||||
function loadBundle(bundlePath) {
|
||||
if (this.legacyRegistry.contains(bundlePath)) {
|
||||
if (legacyRegistry.contains(bundlePath)) {
|
||||
return Promise.resolve(new Bundle(
|
||||
bundlePath,
|
||||
this.legacyRegistry.get(bundlePath)
|
||||
legacyRegistry.get(bundlePath)
|
||||
));
|
||||
}
|
||||
|
||||
@ -109,11 +110,17 @@ define(
|
||||
});
|
||||
}
|
||||
|
||||
// Used to filter out redundant bundles
|
||||
function unique(element, index, array) {
|
||||
return array.indexOf(element) === index;
|
||||
}
|
||||
|
||||
// Load all named bundles from the array, returned as an array
|
||||
// of Bundle objects.
|
||||
function loadBundlesFromArray(bundleArray) {
|
||||
var bundlePromises = this.legacyRegistry.list()
|
||||
var bundlePromises = legacyRegistry.list()
|
||||
.concat(bundleArray)
|
||||
.filter(unique)
|
||||
.map(loadBundle);
|
||||
|
||||
return Promise.all(bundlePromises)
|
||||
|
@ -21,7 +21,7 @@
|
||||
*****************************************************************************/
|
||||
/*global define, window, requirejs*/
|
||||
|
||||
define(['./BundleRegistry'], function (BundleRegistry) {
|
||||
define(['src/BundleRegistry'], function (BundleRegistry) {
|
||||
'use strict';
|
||||
return new BundleRegistry();
|
||||
});
|
Loading…
Reference in New Issue
Block a user