mirror of
https://github.com/nasa/openmct.git
synced 2024-12-18 20:57:53 +00:00
[API] Minimize logic in openmct module
This commit is contained in:
parent
11965304fb
commit
b5f1f98555
19
openmct.js
19
openmct.js
@ -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;
|
||||
});
|
||||
|
13
src/MCT.js
13
src/MCT.js
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user