mirror of
https://github.com/nasa/openmct.git
synced 2025-06-01 23:20:50 +00:00
[Forms] Add example for toolbar
Add example for use of the mct-toolbar directive, WTD-684.
This commit is contained in:
parent
c49e641bca
commit
74e2dbe3f8
@ -1,4 +1,7 @@
|
|||||||
<div ng-controller="ExampleFormController">
|
<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 structure="form" ng-model="state" name="aForm">
|
||||||
</mct-form>
|
</mct-form>
|
||||||
|
|
||||||
|
@ -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 = {
|
$scope.form = {
|
||||||
name: "An example form.",
|
name: "An example form.",
|
||||||
sections: [
|
sections: [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user