[Selection] Go through openmct API

This commit is contained in:
Victor Woeltjen 2016-09-23 15:07:03 -07:00
parent 4ce952846c
commit c411f8fbe3
3 changed files with 17 additions and 11 deletions

View File

@ -28,12 +28,12 @@
<script src="bower_components/requirejs/require.js">
</script>
<script>
require(['main'], function (mct) {
require(['main'], function (openmct) {
require([
'./example/imagery/bundle',
'./example/eventGenerator/bundle',
'./example/generator/bundle'
], mct.run.bind(mct));
], openmct.start.bind(openmct));
});
</script>
<link rel="stylesheet" href="platform/commonUI/general/res/css/startup-base.css">

14
main.js
View File

@ -68,6 +68,7 @@ requirejs.config({
});
define([
'./src/openmct',
'./platform/framework/src/Main',
'legacyRegistry',
@ -105,12 +106,11 @@ define([
'./platform/entanglement/bundle',
'./platform/search/bundle',
'./platform/status/bundle',
'./platform/commonUI/regions/bundle'
], function (Main, legacyRegistry) {
return {
legacyRegistry: legacyRegistry,
run: function () {
'./platform/commonUI/regions/bundle',
'./src/adapter/legacyBundle'
], function (openmct, Main, legacyRegistry) {
openmct.legacyRegistry = legacyRegistry;
openmct.on('start', function () {
return new Main().run(legacyRegistry);
}
};
});
});

View File

@ -21,24 +21,28 @@
*****************************************************************************/
define([
'EventEmitter',
'./selection/Selection',
'./selection/ContextManager',
'./selection/SelectGesture',
'./ui/menu/ContextMenuGesture',
'./ui/ViewRegistry'
], function (
EventEmitter,
Selection,
ContextManager,
SelectGesture,
ContextMenuGesture,
ViewRegistry
) {
var openmct = {};
var openmct = Object.create(EventEmitter.prototype);
var selection = new Selection();
var manager = new ContextManager();
var select = new SelectGesture(manager, selection);
var contextMenu = new ContextMenuGesture(selection, {}, {}, manager);
EventEmitter.call(openmct);
openmct.selection = selection;
openmct.inspectors = new ViewRegistry();
@ -48,5 +52,7 @@ define([
contextual: contextMenu.apply.bind(contextMenu)
};
openmct.start = openmct.emit.bind(openmct, 'start');
return openmct;
});