diff options
author | Valerio Virgillito | 2012-02-15 14:55:21 -0800 |
---|---|---|
committer | Valerio Virgillito | 2012-02-15 14:55:21 -0800 |
commit | 747616980cad14f0b65fbcc7f497ed9680a39d29 (patch) | |
tree | d04fe7a572fd6a0a17a6c631988989e9cd9e43a6 /js/controllers | |
parent | d1bc0d3e8b3ab3341105c3e29dd2ca11a20d8931 (diff) | |
download | ninja-747616980cad14f0b65fbcc7f497ed9680a39d29.tar.gz |
Adding more components pi
Added rest of the components pi.
Missing text-input and select
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/controllers')
-rw-r--r-- | js/controllers/elements/component-controller.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/js/controllers/elements/component-controller.js b/js/controllers/elements/component-controller.js index 7fa62d1e..83450d0f 100644 --- a/js/controllers/elements/component-controller.js +++ b/js/controllers/elements/component-controller.js | |||
@@ -18,7 +18,11 @@ exports.ComponentController = Montage.create(ElementController, { | |||
18 | case "top": | 18 | case "top": |
19 | case "width": | 19 | case "width": |
20 | case "height": | 20 | case "height": |
21 | return ElementController.getProperty(el, prop, true); | 21 | if(el.nodeName === "IMG" && (prop === "width" || prop === "height")) { |
22 | return this.application.ninja.currentDocument.getComponentFromElement(el)[prop]; | ||
23 | } else { | ||
24 | return ElementController.getProperty(el, prop, true); | ||
25 | } | ||
22 | default: | 26 | default: |
23 | return this.application.ninja.currentDocument.getComponentFromElement(el)[prop]; | 27 | return this.application.ninja.currentDocument.getComponentFromElement(el)[prop]; |
24 | } | 28 | } |
@@ -34,9 +38,15 @@ exports.ComponentController = Montage.create(ElementController, { | |||
34 | case "top": | 38 | case "top": |
35 | case "width": | 39 | case "width": |
36 | case "height": | 40 | case "height": |
37 | ElementController.setProperty(el, p, value); | 41 | if(el.nodeName === "IMG" && (p === "width" || p === "height")) { |
42 | this.application.ninja.currentDocument.getComponentFromElement(el)[p] = value; | ||
43 | } else { | ||
44 | ElementController.setProperty(el, p, value); | ||
45 | } | ||
38 | break; | 46 | break; |
39 | default: | 47 | default: |
48 | if(p === "min" || p === "max") value = parseFloat(value); | ||
49 | |||
40 | this.application.ninja.currentDocument.getComponentFromElement(el)[p] = value; | 50 | this.application.ninja.currentDocument.getComponentFromElement(el)[p] = value; |
41 | break; | 51 | break; |
42 | 52 | ||