mirror of
https://github.com/nasa/openmct.git
synced 2024-12-18 20:57:53 +00:00
[Selection] Go through openmct API
This commit is contained in:
parent
4ce952846c
commit
c411f8fbe3
@ -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
14
main.js
@ -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);
|
||||
}
|
||||
};
|
||||
});
|
||||
});
|
||||
|
@ -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;
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user