Files
openmct/platform/commonUI/general/src/BottomBarController.js
Victor Woeltjen 48bcb662c6 [Indicators] Add notion of indicators
Add indicators as a category-of-extension, utilized
from the bottom bar to populate its contents.
WTD-608.
2014-12-15 10:17:02 -08:00

36 lines
968 B
JavaScript

/*global define*/
define(
[],
function () {
"use strict";
/**
* Controller for the bottombar template. Exposes
* available indicators (of extension category "indicators")
* @constructor
*/
function BottomBarController(indicators) {
// Utility function used to instantiate indicators
// from their injected constructors.
function instantiate(Indicator) {
return new Indicator();
}
indicators = indicators.map(instantiate);
return {
/**
* Get all indicators to display.
* @returns {Indicator[]} all indicators
* to display in the bottom bar.
*/
getIndicators: function () {
return indicators;
}
};
}
return BottomBarController;
}
);