mirror of
https://github.com/nasa/openmct.git
synced 2024-12-19 21:27:52 +00:00
[API] Expose Dialog as constructor
...and use it that way from todo plugin
This commit is contained in:
parent
8861644f2d
commit
93872ce074
@ -31,10 +31,12 @@
|
||||
<script type="text/javascript">
|
||||
require(['main'], function (mct) {
|
||||
require([
|
||||
'./tutorials/todo/todo',
|
||||
'./example/imagery/bundle',
|
||||
'./example/eventGenerator/bundle',
|
||||
'./example/generator/bundle',
|
||||
], function () {
|
||||
], function (todo) {
|
||||
todo(mct);
|
||||
mct.run();
|
||||
})
|
||||
});
|
||||
|
@ -4,7 +4,6 @@ define([
|
||||
'uuid',
|
||||
'./api/api',
|
||||
'text!./adapter/templates/edit-object-replacement.html',
|
||||
'./ui/Dialog',
|
||||
'./Selection',
|
||||
'./api/objects/object-utils'
|
||||
], function (
|
||||
@ -13,7 +12,6 @@ define([
|
||||
uuid,
|
||||
api,
|
||||
editObjectTemplate,
|
||||
Dialog,
|
||||
Selection,
|
||||
objectUtils
|
||||
) {
|
||||
@ -119,10 +117,6 @@ define([
|
||||
});
|
||||
};
|
||||
|
||||
MCT.prototype.dialog = function (view, title) {
|
||||
return new Dialog(view, title).show();
|
||||
};
|
||||
|
||||
MCT.prototype.start = function () {
|
||||
this.legacyExtension('runs', {
|
||||
depends: ['navigationService'],
|
||||
|
@ -3,19 +3,22 @@ define([
|
||||
'./TimeConductor',
|
||||
'./View',
|
||||
'./objects/ObjectAPI',
|
||||
'./composition/CompositionAPI'
|
||||
'./composition/CompositionAPI',
|
||||
'./ui/Dialog'
|
||||
], function (
|
||||
Type,
|
||||
TimeConductor,
|
||||
View,
|
||||
ObjectAPI,
|
||||
CompositionAPI
|
||||
CompositionAPI,
|
||||
Dialog
|
||||
) {
|
||||
return {
|
||||
Type: Type,
|
||||
TimeConductor: new TimeConductor(),
|
||||
View: View,
|
||||
Objects: ObjectAPI,
|
||||
Composition: CompositionAPI
|
||||
Composition: CompositionAPI,
|
||||
Dialog: Dialog
|
||||
};
|
||||
});
|
||||
|
@ -163,7 +163,7 @@ define([
|
||||
destroy: function () {}
|
||||
};
|
||||
|
||||
mct.dialog(view, "Add a Task").then(function () {
|
||||
new mct.Dialog(view, "Add a Task").show().then(function () {
|
||||
var description = $dialog.find('input').val();
|
||||
var tasks = self.mutableObject.get('tasks');
|
||||
tasks.push({ description: description });
|
||||
|
Loading…
Reference in New Issue
Block a user