From 62d90a8114d1c53be129aed4e3b881dde32420fd Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Thu, 28 Jul 2016 15:57:15 -0700 Subject: [PATCH] [API] Show dialog via mct --- src/adapter/actions/ActionDialogDecorator.js | 11 +++++++++-- src/adapter/bundle.js | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/adapter/actions/ActionDialogDecorator.js b/src/adapter/actions/ActionDialogDecorator.js index a586109996..44d0fa9a24 100644 --- a/src/adapter/actions/ActionDialogDecorator.js +++ b/src/adapter/actions/ActionDialogDecorator.js @@ -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); } } diff --git a/src/adapter/bundle.js b/src/adapter/bundle.js index 3616078331..9ffd4829fa 100644 --- a/src/adapter/bundle.js +++ b/src/adapter/bundle.js @@ -47,7 +47,8 @@ define([ { type: "decorator", provides: "actionService", - implementation: ActionDialogDecorator + implementation: ActionDialogDecorator, + depends: [ "mct" ] } ] }