[Fixed Position] Add text, image properties

Add buttons for text, image properties to the Fixed Position
toolbar, WTD-881.
This commit is contained in:
Victor Woeltjen 2015-02-23 19:16:09 -08:00
parent 0030efc29e
commit 1c69d1f2da
5 changed files with 27 additions and 13 deletions

View File

@ -101,8 +101,8 @@
},
{
"property": "url",
"glyph": "",
"control": "dialog",
"glyph": "\u2353",
"control": "dialog-button",
"title": "Image Properties",
"dialog": {
"control": "textfield",
@ -112,8 +112,8 @@
},
{
"property": "text",
"glyph": "",
"control": "dialog",
"glyph": "p",
"control": "dialog-button",
"title": "Text Properties",
"dialog": {
"control": "textfield",

View File

@ -1,15 +1,15 @@
/*global define*/
define(
['./TelemetryProxy', './ElementProxy', './LineProxy', './BoxProxy', './TextProxy'],
function (TelemetryProxy, ElementProxy, LineProxy, BoxProxy, TextProxy) {
['./TelemetryProxy', './ImageProxy', './LineProxy', './BoxProxy', './TextProxy'],
function (TelemetryProxy, ImageProxy, LineProxy, BoxProxy, TextProxy) {
"use strict";
return {
"fixed.telemetry": TelemetryProxy,
"fixed.line": LineProxy,
"fixed.box": BoxProxy,
"fixed.image": ElementProxy,
"fixed.image": ImageProxy,
"fixed.text": TextProxy
};
}

View File

@ -49,6 +49,10 @@
{
"key": "menu-button",
"templateUrl": "templates/controls/menu-button.html"
},
{
"key": "dialog-button",
"templateUrl": "templates/controls/dialog.html"
}
],
"controllers": [
@ -64,6 +68,11 @@
{
"key": "ColorController",
"implementation": "controllers/ColorController.js"
},
{
"key": "DialogButtonController",
"implementation": "controllers/DialogButtonController.js",
"depends": [ "$scope", "dialogService" ]
}
]
}

View File

@ -1,4 +1,5 @@
<mct-control ng-controller="DialogButtonController as dialog"
key="'button'"
structure="dialog.getStructure()">
</mct-control>
<span ng-controller="DialogButtonController as dialog">
<mct-control key="'button'"
structure="dialog.getButtonStructure()">
</mct-control>
</span>

View File

@ -25,8 +25,12 @@ define(
// Prompt for user input
function showDialog() {
dialogService.getUserInput(buttonForm, $scope.ngModel)
.then(storeResult);
// Prepare initial state
var state = {};
state[$scope.field] = $scope.ngModel[$scope.field];
// Show dialog, then store user input (if any)
dialogService.getUserInput(buttonForm, state).then(storeResult);
}
// Refresh state based on structure for this control