[API] Minimize logic in openmct module

This commit is contained in:
Victor Woeltjen 2016-09-30 12:38:03 -07:00
parent 11965304fb
commit b5f1f98555
2 changed files with 16 additions and 16 deletions

View File

@ -72,28 +72,17 @@ requirejs.config({
});
define([
'./src/openmct',
'./platform/framework/src/Main',
'./src/defaultRegistry',
'./src/MCT'
], function (Main, defaultRegistry, MCT) {
var mct = new MCT();
var openmct = new MCT();
mct.legacyRegistry = defaultRegistry;
openmct.legacyRegistry = defaultRegistry;
mct.run = function (domElement) {
if (!domElement) { domElement = document.body; }
var appDiv = document.createElement('div');
appDiv.setAttribute('ng-view', '');
appDiv.className = 'user-environ';
domElement.appendChild(appDiv);
mct.start();
};
mct.on('start', function () {
openmct.on('start', function () {
return new Main().run(defaultRegistry);
});
return mct;
return openmct;
});

View File

@ -194,8 +194,19 @@ define([
* @fires module:openmct.MCT~start
* @memberof module:openmct.MCT#
* @method start
* @param {HTMLElement} [domElement] the DOM element in which to run
* MCT; if undefined, MCT will be run in the body of the document
*/
MCT.prototype.start = function () {
MCT.prototype.start = function (domElement) {
if (!domElement) {
domElement = document.body;
}
var appDiv = document.createElement('div');
appDiv.setAttribute('ng-view', '');
appDiv.className = 'user-environ';
domElement.appendChild(appDiv);
this.legacyExtension('runs', {
depends: ['navigationService'],
implementation: function (navigationService) {