diff options
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 | ||