[Forms] Add example for toolbar

Add example for use of the mct-toolbar directive,
WTD-684.
This commit is contained in:
Victor Woeltjen 2015-01-15 15:36:07 -08:00
parent c49e641bca
commit 74e2dbe3f8
2 changed files with 85 additions and 0 deletions

View File

@ -1,4 +1,7 @@
<div ng-controller="ExampleFormController">
<mct-toolbar structure="toolbar" ng-model="state" name="aToolbar">
</mct-toolbar>
<mct-form structure="form" ng-model="state" name="aForm">
</mct-form>

View File

@ -10,6 +10,88 @@ define(
};
$scope.toolbar = {
name: "An example toolbar.",
sections: [
{
description: "First section",
items: [
{
name: "X",
description: "X coordinate",
control: "textfield",
pattern: "^\\d+$",
size: 2,
key: "x"
},
{
name: "Y",
description: "Y coordinate",
control: "textfield",
pattern: "^\\d+$",
size: 2,
key: "y"
},
{
name: "W",
description: "Cell width",
control: "textfield",
pattern: "^\\d+$",
size: 2,
key: "w"
},
{
name: "H",
description: "Cell height",
control: "textfield",
pattern: "^\\d+$",
size: 2,
key: "h"
}
]
},
{
description: "Second section",
items: [
{
control: "button",
glyph: "1",
description: "Button A",
click: function () {
window.alert("A");
}
},
{
control: "button",
glyph: "2",
description: "Button B",
click: function () {
window.alert("B");
}
},
{
control: "button",
glyph: "3",
description: "Button C",
disabled: true,
click: function () {
window.alert("C");
}
}
]
},
{
items: [
{
control: "color",
key: "color"
}
]
}
]
};
$scope.form = {
name: "An example form.",
sections: [