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