diff options
Diffstat (limited to 'js/controllers/elements/element-controller.js')
-rwxr-xr-x | js/controllers/elements/element-controller.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js index 941e05ba..e40a646a 100755 --- a/js/controllers/elements/element-controller.js +++ b/js/controllers/elements/element-controller.js | |||
@@ -19,13 +19,13 @@ exports.ElementController = Montage.create(Component, { | |||
19 | var selectedLayerIndex = this.application.ninja.timeline.getLayerIndexByID(this.application.ninja.timeline.currentLayerSelected.layerData.layerID); | 19 | var selectedLayerIndex = this.application.ninja.timeline.getLayerIndexByID(this.application.ninja.timeline.currentLayerSelected.layerData.layerID); |
20 | 20 | ||
21 | if(selectedLayerIndex === 0) { | 21 | if(selectedLayerIndex === 0) { |
22 | this.application.ninja.currentSelectedContainer.appendChild(el); | 22 | this.application.ninja.currentDocument.model.domContainer.appendChild(el); |
23 | } else { | 23 | } else { |
24 | var element = this.application.ninja.timeline.arrLayers[selectedLayerIndex].layerData.elementsList[0]; | 24 | var element = this.application.ninja.timeline.arrLayers[selectedLayerIndex].layerData.elementsList[0]; |
25 | element.parentNode.insertBefore(el, element.nextSibling); | 25 | element.parentNode.insertBefore(el, element.nextSibling); |
26 | } | 26 | } |
27 | } else { | 27 | } else { |
28 | this.application.ninja.currentSelectedContainer.appendChild(el); | 28 | this.application.ninja.currentDocument.model.domContainer.appendChild(el); |
29 | } | 29 | } |
30 | 30 | ||
31 | if(styles) { | 31 | if(styles) { |
@@ -37,7 +37,7 @@ exports.ElementController = Montage.create(Component, { | |||
37 | // Remove the element from the DOM and clear the GLWord. | 37 | // Remove the element from the DOM and clear the GLWord. |
38 | removeElement: { | 38 | removeElement: { |
39 | value: function(el) { | 39 | value: function(el) { |
40 | if(el.elementModel && el.elementModel.shapeModel && el.elementModel.shapeModel.GLWorld) { | 40 | if(el.elementModel.shapeModel && el.elementModel.shapeModel.GLWorld) { |
41 | el.elementModel.shapeModel.GLWorld.clearTree(); | 41 | el.elementModel.shapeModel.GLWorld.clearTree(); |
42 | } | 42 | } |
43 | el.parentNode.removeChild(el); | 43 | el.parentNode.removeChild(el); |
@@ -277,7 +277,7 @@ exports.ElementController = Montage.create(Component, { | |||
277 | // Routines to get/set 3D properties | 277 | // Routines to get/set 3D properties |
278 | get3DProperty: { | 278 | get3DProperty: { |
279 | value: function(el, prop) { | 279 | value: function(el, prop) { |
280 | if(el.elementModel && el.elementModel.props3D) { | 280 | if(el.elementModel.props3D) { |
281 | return el.elementModel.props3D[prop]; | 281 | return el.elementModel.props3D[prop]; |
282 | } | 282 | } |
283 | } | 283 | } |
@@ -285,7 +285,7 @@ exports.ElementController = Montage.create(Component, { | |||
285 | 285 | ||
286 | getMatrix: { | 286 | getMatrix: { |
287 | value: function(el) { | 287 | value: function(el) { |
288 | if(el.elementModel && el.elementModel.props3D && el.elementModel.props3D.matrix3d) { | 288 | if(el.elementModel.props3D && el.elementModel.props3D.matrix3d) { |
289 | return el.elementModel.props3D.matrix3d.slice(0); | 289 | return el.elementModel.props3D.matrix3d.slice(0); |
290 | } else { | 290 | } else { |
291 | var mat; | 291 | var mat; |
@@ -305,7 +305,7 @@ exports.ElementController = Montage.create(Component, { | |||
305 | 305 | ||
306 | getPerspectiveDist: { | 306 | getPerspectiveDist: { |
307 | value: function(el) { | 307 | value: function(el) { |
308 | if(el.elementModel && el.elementModel.props3D && el.elementModel.props3D.perspectiveDist) { | 308 | if(el.elementModel.props3D && el.elementModel.props3D.perspectiveDist) { |
309 | return el.elementModel.props3D.perspectiveDist; | 309 | return el.elementModel.props3D.perspectiveDist; |
310 | } else { | 310 | } else { |
311 | var dist = this.application.ninja.stylesController.getPerspectiveDistFromElement(el, false); | 311 | var dist = this.application.ninja.stylesController.getPerspectiveDistFromElement(el, false); |