aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/elements/component-controller.js
diff options
context:
space:
mode:
authorValerio Virgillito2012-02-14 11:22:21 -0800
committerValerio Virgillito2012-02-14 11:22:21 -0800
commitab1466b2627e40f58afcaa3d425d4145fa47525a (patch)
tree5c0de8b4db67b07b0e745e776e99eabff989d804 /js/controllers/elements/component-controller.js
parent33c805d441abb2f83fd1ac9ee2d3d4282acc009f (diff)
parentdf898049b2990f456a305eb18434b887468225cf (diff)
downloadninja-ab1466b2627e40f58afcaa3d425d4145fa47525a.tar.gz
Merge branch 'components' of https://github.com/mencio/ninja-internal into integration
Conflicts: js/io/document/html-document.js Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/controllers/elements/component-controller.js')
-rwxr-xr-xjs/controllers/elements/component-controller.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/js/controllers/elements/component-controller.js b/js/controllers/elements/component-controller.js
index 458e6b46..33b9b79a 100755
--- a/js/controllers/elements/component-controller.js
+++ b/js/controllers/elements/component-controller.js
@@ -9,4 +9,45 @@ var Montage = require("montage/core/core").Montage,
9 9
10exports.ComponentController = Montage.create(ElementController, { 10exports.ComponentController = Montage.create(ElementController, {
11 11
12 getProperty: {
13 value: function(el, prop) {
14 switch(prop) {
15 case "label":
16 return this.application.ninja.currentDocument.getComponentFromElement(el).label;
17 break;
18 case "enabled":
19 return this.application.ninja.currentDocument.getComponentFromElement(el).enabled;
20 break;
21 case "disabled":
22 return this.application.ninja.currentDocument.getComponentFromElement(el).disabled;
23 break;
24 case "value":
25 return this.application.ninja.currentDocument.getComponentFromElement(el).value;
26 break;
27 default:
28 return ElementController.getProperty(el, prop, true);
29 }
30 }
31 },
32
33 setProperty: {
34 value: function(el, p, value) {
35 switch(p) {
36 case "label":
37 this.application.ninja.currentDocument.getComponentFromElement(el).label = value;
38 break;
39 case "enabled":
40 this.application.ninja.currentDocument.getComponentFromElement(el).enabled = value;
41 break;
42 case "disabled":
43 this.application.ninja.currentDocument.getComponentFromElement(el).disabled = value;
44 break;
45 case "value":
46 this.application.ninja.currentDocument.getComponentFromElement(el).value = value;
47 break;
48 default:
49 ElementController.setProperty(el, p, value);
50 }
51 }
52 }
12}); 53});