From 74e2dbe3f85b288f9514df0a4a367dd2f8589d23 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Thu, 15 Jan 2015 15:36:07 -0800 Subject: [PATCH] [Forms] Add example for toolbar Add example for use of the mct-toolbar directive, WTD-684. --- example/forms/res/templates/exampleForm.html | 3 + example/forms/src/ExampleFormController.js | 82 ++++++++++++++++++++ 2 files changed, 85 insertions(+) diff --git a/example/forms/res/templates/exampleForm.html b/example/forms/res/templates/exampleForm.html index 70c65f3ab4..2360b0df97 100644 --- a/example/forms/res/templates/exampleForm.html +++ b/example/forms/res/templates/exampleForm.html @@ -1,4 +1,7 @@
+ + + diff --git a/example/forms/src/ExampleFormController.js b/example/forms/src/ExampleFormController.js index fd71122085..99af83456e 100644 --- a/example/forms/src/ExampleFormController.js +++ b/example/forms/src/ExampleFormController.js @@ -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: [