aboutsummaryrefslogtreecommitdiff
path: root/js/controllers
diff options
context:
space:
mode:
authorValerio Virgillito2012-06-05 21:40:44 -0700
committerValerio Virgillito2012-06-05 21:40:44 -0700
commite28eb9158a50d7e6d97dbc68066e591ac600c241 (patch)
tree1615affe62374ae67eaecb8b1966a2f464559dfa /js/controllers
parentd7555c35b357e28a1e1ccc1c4edc4fe04d2b139a (diff)
downloadninja-e28eb9158a50d7e6d97dbc68066e591ac600c241.tar.gz
removing all model creators.
The elementModel is now a getter that will create a new model when needed. Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/controllers')
-rwxr-xr-xjs/controllers/elements/body-controller.js4
-rwxr-xr-xjs/controllers/elements/element-controller.js8
-rwxr-xr-xjs/controllers/elements/shapes-controller.js2
3 files changed, 7 insertions, 7 deletions
diff --git a/js/controllers/elements/body-controller.js b/js/controllers/elements/body-controller.js
index 7a3a66f5..9c427c62 100755
--- a/js/controllers/elements/body-controller.js
+++ b/js/controllers/elements/body-controller.js
@@ -71,7 +71,7 @@ exports.BodyController = Montage.create(ElementController, {
71 71
72 getPerspectiveDist: { 72 getPerspectiveDist: {
73 value: function(el) { 73 value: function(el) {
74 if(el.elementModel && el.elementModel.props3D && el.elementModel.props3D.perspectiveDist) { 74 if(el.elementModel.props3D && el.elementModel.props3D.perspectiveDist) {
75 return el.elementModel.props3D.perspectiveDist; 75 return el.elementModel.props3D.perspectiveDist;
76 } else { 76 } else {
77 var dist = this.application.ninja.stylesController.getPerspectiveDistFromElement(el, true); 77 var dist = this.application.ninja.stylesController.getPerspectiveDistFromElement(el, true);
@@ -83,7 +83,7 @@ exports.BodyController = Montage.create(ElementController, {
83 83
84 getMatrix: { 84 getMatrix: {
85 value: function(el) { 85 value: function(el) {
86 if(el.elementModel && el.elementModel.props3D && el.elementModel.props3D.matrix3d) 86 if(el.elementModel.props3D && el.elementModel.props3D.matrix3d)
87 { 87 {
88 return el.elementModel.props3D.matrix3d.slice(0); 88 return el.elementModel.props3D.matrix3d.slice(0);
89 } 89 }
diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js
index 01e132d7..0223a6b5 100755
--- a/js/controllers/elements/element-controller.js
+++ b/js/controllers/elements/element-controller.js
@@ -36,7 +36,7 @@ exports.ElementController = Montage.create(Component, {
36 // Remove the element from the DOM and clear the GLWord. 36 // Remove the element from the DOM and clear the GLWord.
37 removeElement: { 37 removeElement: {
38 value: function(el) { 38 value: function(el) {
39 if(el.elementModel && el.elementModel.shapeModel && el.elementModel.shapeModel.GLWorld) { 39 if(el.elementModel.shapeModel && el.elementModel.shapeModel.GLWorld) {
40 el.elementModel.shapeModel.GLWorld.clearTree(); 40 el.elementModel.shapeModel.GLWorld.clearTree();
41 } 41 }
42 el.parentNode.removeChild(el); 42 el.parentNode.removeChild(el);
@@ -229,7 +229,7 @@ exports.ElementController = Montage.create(Component, {
229 // Routines to get/set 3D properties 229 // Routines to get/set 3D properties
230 get3DProperty: { 230 get3DProperty: {
231 value: function(el, prop) { 231 value: function(el, prop) {
232 if(el.elementModel && el.elementModel.props3D) { 232 if(el.elementModel.props3D) {
233 return el.elementModel.props3D[prop]; 233 return el.elementModel.props3D[prop];
234 } 234 }
235 } 235 }
@@ -237,7 +237,7 @@ exports.ElementController = Montage.create(Component, {
237 237
238 getMatrix: { 238 getMatrix: {
239 value: function(el) { 239 value: function(el) {
240 if(el.elementModel && el.elementModel.props3D && el.elementModel.props3D.matrix3d) { 240 if(el.elementModel.props3D && el.elementModel.props3D.matrix3d) {
241 return el.elementModel.props3D.matrix3d.slice(0); 241 return el.elementModel.props3D.matrix3d.slice(0);
242 } else { 242 } else {
243 var mat; 243 var mat;
@@ -257,7 +257,7 @@ exports.ElementController = Montage.create(Component, {
257 257
258 getPerspectiveDist: { 258 getPerspectiveDist: {
259 value: function(el) { 259 value: function(el) {
260 if(el.elementModel && el.elementModel.props3D && el.elementModel.props3D.perspectiveDist) { 260 if(el.elementModel.props3D && el.elementModel.props3D.perspectiveDist) {
261 return el.elementModel.props3D.perspectiveDist; 261 return el.elementModel.props3D.perspectiveDist;
262 } else { 262 } else {
263 var dist = this.application.ninja.stylesController.getPerspectiveDistFromElement(el, false); 263 var dist = this.application.ninja.stylesController.getPerspectiveDistFromElement(el, false);
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js
index 626dedb6..ae345489 100755
--- a/js/controllers/elements/shapes-controller.js
+++ b/js/controllers/elements/shapes-controller.js
@@ -133,7 +133,7 @@ exports.ShapesController = Montage.create(CanvasController, {
133 canvas.setAttribute("data-RDGE-id", njModule.NJUtils.generateRandom()); 133 canvas.setAttribute("data-RDGE-id", njModule.NJUtils.generateRandom());
134 canvas.width = el.width; 134 canvas.width = el.width;
135 canvas.height = el.height; 135 canvas.height = el.height;
136 canvas.elementModel = el.elementModel; 136 canvas._model = el.elementModel;
137 this.toggleWebGlMode(canvas, value); 137 this.toggleWebGlMode(canvas, value);
138 this.application.ninja.elementMediator.replaceElement(canvas, el); 138 this.application.ninja.elementMediator.replaceElement(canvas, el);
139 break; 139 break;