[API] Expose Dialog as constructor

...and use it that way from todo plugin
This commit is contained in:
Victor Woeltjen
2016-08-11 16:04:26 -07:00
parent 8861644f2d
commit 93872ce074
6 changed files with 10 additions and 11 deletions

View File

@ -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();
}) })
}); });

View File

@ -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'],

View File

@ -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
}; };
}); });

View File

@ -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 });