mirror of
https://github.com/nasa/openmct.git
synced 2024-12-20 05:37:53 +00:00
[API] Show dialog via mct
This commit is contained in:
parent
87682607a5
commit
62d90a8114
@ -1,14 +1,21 @@
|
||||
define([], function () {
|
||||
function ActionDialogDecorator(actionService) {
|
||||
function ActionDialogDecorator(mct, actionService) {
|
||||
this.actionService = actionService;
|
||||
this.mct = mct;
|
||||
}
|
||||
|
||||
ActionDialogDecorator.prototype.getActions = function (context) {
|
||||
var mct = this.mct;
|
||||
return this.actionService.getActions(context).map(function (action) {
|
||||
if (action.dialogService) {
|
||||
action.dialogService = Object.create(action.dialogService);
|
||||
action.dialogService.getUserInput = function (form, value) {
|
||||
window.alert("Get user input!");
|
||||
mct.dialog({
|
||||
show: function (container) {
|
||||
container.textContent = JSON.stringify(value);
|
||||
},
|
||||
destroy: function () {}
|
||||
}, form.title);
|
||||
return Promise.resolve(value);
|
||||
}
|
||||
}
|
||||
|
@ -47,7 +47,8 @@ define([
|
||||
{
|
||||
type: "decorator",
|
||||
provides: "actionService",
|
||||
implementation: ActionDialogDecorator
|
||||
implementation: ActionDialogDecorator,
|
||||
depends: [ "mct" ]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user