diff options
Diffstat (limited to 'js')
-rw-r--r-- | js/controllers/elements/component-controller.js | 14 | ||||
-rw-r--r-- | js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js | 8 |
2 files changed, 18 insertions, 4 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 | ||
diff --git a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js b/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js index 987cd6b5..bcb14013 100644 --- a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js +++ b/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js | |||
@@ -195,6 +195,8 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component | |||
195 | return "checkbox"; | 195 | return "checkbox"; |
196 | case "select": | 196 | case "select": |
197 | return "dropdown"; | 197 | return "dropdown"; |
198 | case "number": | ||
199 | return "hottext"; | ||
198 | default: | 200 | default: |
199 | alert("Conversion not implemented for ", type); | 201 | alert("Conversion not implemented for ", type); |
200 | } | 202 | } |
@@ -287,7 +289,9 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component | |||
287 | break; | 289 | break; |
288 | case "imageComponent": | 290 | case "imageComponent": |
289 | el = NJUtils.makeNJElement("image", "Image", "component"); | 291 | el = NJUtils.makeNJElement("image", "Image", "component"); |
290 | el.elementModel.pi = "ImageComponentPi"; | 292 | el.elementModel.pi = "ImagePi"; |
293 | el.setAttribute("width", 200); | ||
294 | el.setAttribute("height", 200); | ||
291 | break; | 295 | break; |
292 | case "numberInput": | 296 | case "numberInput": |
293 | el = NJUtils.makeNJElement("input", "Number Input", "component"); | 297 | el = NJUtils.makeNJElement("input", "Number Input", "component"); |
@@ -315,7 +319,7 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component | |||
315 | break; | 319 | break; |
316 | case "textarea": | 320 | case "textarea": |
317 | el = NJUtils.makeNJElement("textarea", "TextArea", "component"); | 321 | el = NJUtils.makeNJElement("textarea", "TextArea", "component"); |
318 | el.elementModel.pi = "TextArea"; | 322 | el.elementModel.pi = "TextAreaPi"; |
319 | break; | 323 | break; |
320 | case "toggleButton": | 324 | case "toggleButton": |
321 | el = NJUtils.makeNJElement("button", "Toggle Button", "component"); | 325 | el = NJUtils.makeNJElement("button", "Toggle Button", "component"); |