aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/elements
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-02-20 11:14:44 -0800
committerNivesh Rajbhandari2012-02-20 11:14:44 -0800
commitabf78e2d7a97d295ce5a1c425fd359d47379137e (patch)
treed08c91bd2aef31e6325e0b499b2ffc390018bec6 /js/controllers/elements
parente80a79bff57fecf3aa9b869d8ed2de5fd815287c (diff)
parente23708721a71ca4c71365f5f8e8ac7d6113926db (diff)
downloadninja-abf78e2d7a97d295ce5a1c425fd359d47379137e.tar.gz
Merge branch 'refs/heads/ninja-internal' into ToolFixes
Diffstat (limited to 'js/controllers/elements')
-rwxr-xr-x[-rw-r--r--]js/controllers/elements/block-controller.js0
-rwxr-xr-x[-rw-r--r--]js/controllers/elements/canvas-controller.js0
-rwxr-xr-x[-rw-r--r--]js/controllers/elements/component-controller.js44
-rwxr-xr-x[-rw-r--r--]js/controllers/elements/controller-factory.js0
-rwxr-xr-x[-rw-r--r--]js/controllers/elements/element-controller.js0
-rwxr-xr-x[-rw-r--r--]js/controllers/elements/image-controller.js0
-rwxr-xr-x[-rw-r--r--]js/controllers/elements/shapes-controller.js1
-rwxr-xr-x[-rw-r--r--]js/controllers/elements/stage-controller.js0
-rwxr-xr-x[-rw-r--r--]js/controllers/elements/video-controller.js0
9 files changed, 45 insertions, 0 deletions
diff --git a/js/controllers/elements/block-controller.js b/js/controllers/elements/block-controller.js
index 395a1a4d..395a1a4d 100644..100755
--- a/js/controllers/elements/block-controller.js
+++ b/js/controllers/elements/block-controller.js
diff --git a/js/controllers/elements/canvas-controller.js b/js/controllers/elements/canvas-controller.js
index b5df3911..b5df3911 100644..100755
--- a/js/controllers/elements/canvas-controller.js
+++ b/js/controllers/elements/canvas-controller.js
diff --git a/js/controllers/elements/component-controller.js b/js/controllers/elements/component-controller.js
index 458e6b46..83450d0f 100644..100755
--- a/js/controllers/elements/component-controller.js
+++ b/js/controllers/elements/component-controller.js
@@ -9,4 +9,48 @@ 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 "id":
16 case "class":
17 case "left":
18 case "top":
19 case "width":
20 case "height":
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 }
26 default:
27 return this.application.ninja.currentDocument.getComponentFromElement(el)[prop];
28 }
29 }
30 },
31
32 setProperty: {
33 value: function(el, p, value) {
34 switch(p) {
35 case "id":
36 case "class":
37 case "left":
38 case "top":
39 case "width":
40 case "height":
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 }
46 break;
47 default:
48 if(p === "min" || p === "max") value = parseFloat(value);
49
50 this.application.ninja.currentDocument.getComponentFromElement(el)[p] = value;
51 break;
52
53 }
54 }
55 }
12}); 56});
diff --git a/js/controllers/elements/controller-factory.js b/js/controllers/elements/controller-factory.js
index a772eb16..a772eb16 100644..100755
--- a/js/controllers/elements/controller-factory.js
+++ b/js/controllers/elements/controller-factory.js
diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js
index 5eb75613..5eb75613 100644..100755
--- a/js/controllers/elements/element-controller.js
+++ b/js/controllers/elements/element-controller.js
diff --git a/js/controllers/elements/image-controller.js b/js/controllers/elements/image-controller.js
index 5abce13e..5abce13e 100644..100755
--- a/js/controllers/elements/image-controller.js
+++ b/js/controllers/elements/image-controller.js
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js
index 8953f155..e0bff70c 100644..100755
--- a/js/controllers/elements/shapes-controller.js
+++ b/js/controllers/elements/shapes-controller.js
@@ -59,6 +59,7 @@ exports.ShapesController = Montage.create(CanvasController, {
59 break; 59 break;
60 case "useWebGl": 60 case "useWebGl":
61 var canvas = njModule.NJUtils.makeNJElement("canvas", "Canvas", "shape", el.className, true); 61 var canvas = njModule.NJUtils.makeNJElement("canvas", "Canvas", "shape", el.className, true);
62 canvas.setAttribute("data-RDGE-id", njModule.NJUtils.generateRandom());
62 canvas.width = el.width; 63 canvas.width = el.width;
63 canvas.height = el.height; 64 canvas.height = el.height;
64 this.application.ninja.elementMediator.replaceElement(el, canvas); 65 this.application.ninja.elementMediator.replaceElement(el, canvas);
diff --git a/js/controllers/elements/stage-controller.js b/js/controllers/elements/stage-controller.js
index a8546662..a8546662 100644..100755
--- a/js/controllers/elements/stage-controller.js
+++ b/js/controllers/elements/stage-controller.js
diff --git a/js/controllers/elements/video-controller.js b/js/controllers/elements/video-controller.js
index c36752f5..c36752f5 100644..100755
--- a/js/controllers/elements/video-controller.js
+++ b/js/controllers/elements/video-controller.js