aboutsummaryrefslogtreecommitdiff
path: root/js/stage
diff options
context:
space:
mode:
authorValerio Virgillito2012-05-24 11:59:17 -0700
committerValerio Virgillito2012-05-24 11:59:17 -0700
commit70ff8dd670bc37c14caf850e06791d1e293b1e4b (patch)
tree8e00a27c6c908dda3e816d1f5aaf0d2a889ca5dc /js/stage
parenta8eb5c65a21af3bf8d8b8eb3e65b494b8bd9bc01 (diff)
parenta6db492176a85546047dae6d5ecb9cfc4325e043 (diff)
downloadninja-70ff8dd670bc37c14caf850e06791d1e293b1e4b.tar.gz
Merge pull request #255 from joseeight/Document
Cleaning up referencing to documentRoot
Diffstat (limited to 'js/stage')
-rwxr-xr-xjs/stage/layout.js6
-rwxr-xr-xjs/stage/stage.reel/stage.js14
-rwxr-xr-xjs/stage/tool-handle.js4
3 files changed, 12 insertions, 12 deletions
diff --git a/js/stage/layout.js b/js/stage/layout.js
index 71959f86..460c8b4a 100755
--- a/js/stage/layout.js
+++ b/js/stage/layout.js
@@ -62,7 +62,7 @@ exports.Layout = Montage.create(Component, {
62 value: function() { 62 value: function() {
63 // Initial elements to draw are the childrens of the root element 63 // Initial elements to draw are the childrens of the root element
64 if(this.application.ninja.documentController.activeDocument.currentView === "design") { 64 if(this.application.ninja.documentController.activeDocument.currentView === "design") {
65 this.elementsToDraw = this.application.ninja.documentController.activeDocument.documentRoot.childNodes; 65 this.elementsToDraw = this.application.ninja.documentController.activeDocument.model.documentRoot.childNodes;
66 } 66 }
67 } 67 }
68 }, 68 },
@@ -237,7 +237,7 @@ exports.Layout = Montage.create(Component, {
237 value: function() { 237 value: function() {
238 if(this.application.ninja.currentDocument) { 238 if(this.application.ninja.currentDocument) {
239 this.clearCanvas(); 239 this.clearCanvas();
240 this.WalkDOM(this.application.ninja.currentDocument.documentRoot); 240 this.WalkDOM(this.application.ninja.currentDocument.model.documentRoot);
241 241
242 //drawUtils.updatePlanes(); 242 //drawUtils.updatePlanes();
243 //if(this.application.ninja.currentDocument.draw3DGrid) drawUtils.drawWorkingPlane(); 243 //if(this.application.ninja.currentDocument.draw3DGrid) drawUtils.drawWorkingPlane();
@@ -249,7 +249,7 @@ exports.Layout = Montage.create(Component, {
249 drawElementsOutline: { 249 drawElementsOutline: {
250 value: function(elements) { 250 value: function(elements) {
251 this.clearCanvas(); 251 this.clearCanvas();
252 this.WalkDOM(this.application.ninja.currentDocument.documentRoot, elements); 252 this.WalkDOM(this.application.ninja.currentDocument.model.documentRoot, elements);
253 } 253 }
254 }, 254 },
255 255
diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js
index 6d421e4b..c7afb95c 100755
--- a/js/stage/stage.reel/stage.js
+++ b/js/stage/stage.reel/stage.js
@@ -186,7 +186,7 @@ exports.Stage = Montage.create(Component, {
186 set: function(value) { 186 set: function(value) {
187 this._userPaddingLeft = value; 187 this._userPaddingLeft = value;
188 this._documentOffsetLeft = -value; 188 this._documentOffsetLeft = -value;
189 this.application.ninja.currentDocument.documentRoot.ownerDocument.getElementsByTagName("HTML")[0].style["padding-left"] = -value + "px"; 189 this.application.ninja.currentDocument.model.documentRoot.ownerDocument.getElementsByTagName("HTML")[0].style["padding-left"] = -value + "px";
190 this.userContentLeft = this._documentOffsetLeft; 190 this.userContentLeft = this._documentOffsetLeft;
191 this.updatedStage = true; 191 this.updatedStage = true;
192 } 192 }
@@ -197,7 +197,7 @@ exports.Stage = Montage.create(Component, {
197 set: function(value) { 197 set: function(value) {
198 this._userPaddingTop = value; 198 this._userPaddingTop = value;
199 this._documentOffsetTop = -value; 199 this._documentOffsetTop = -value;
200 this.application.ninja.currentDocument.documentRoot.ownerDocument.getElementsByTagName("HTML")[0].style["padding-top"] = -value + "px"; 200 this.application.ninja.currentDocument.model.documentRoot.ownerDocument.getElementsByTagName("HTML")[0].style["padding-top"] = -value + "px";
201 this.userContentTop = this._documentOffsetTop; 201 this.userContentTop = this._documentOffsetTop;
202 this.updatedStage = true; 202 this.updatedStage = true;
203 } 203 }
@@ -904,7 +904,7 @@ exports.Stage = Montage.create(Component, {
904 904
905 setStageAsViewport: { 905 setStageAsViewport: {
906 value: function() { 906 value: function() {
907 this.stageDeps.viewUtils.setViewportObj(this.application.ninja.currentDocument.documentRoot); 907 this.stageDeps.viewUtils.setViewportObj(this.application.ninja.currentDocument.model.documentRoot);
908 } 908 }
909 }, 909 },
910 910
@@ -912,7 +912,7 @@ exports.Stage = Montage.create(Component, {
912 value: function(value) { 912 value: function(value) {
913 if(!this._firstDraw) 913 if(!this._firstDraw)
914 { 914 {
915 var userContent = this.application.ninja.currentDocument.documentRoot; 915 var userContent = this.application.ninja.currentDocument.model.documentRoot;
916 if (userContent) 916 if (userContent)
917 { 917 {
918 var w = this._canvas.width, 918 var w = this._canvas.width,
@@ -943,12 +943,12 @@ exports.Stage = Montage.create(Component, {
943 { 943 {
944 case "top": 944 case "top":
945 plane = [0,1,0,0]; 945 plane = [0,1,0,0];
946 plane[3] = this.application.ninja.currentDocument.documentRoot.offsetHeight / 2.0; 946 plane[3] = this.application.ninja.currentDocument.model.documentRoot.offsetHeight / 2.0;
947 break; 947 break;
948 948
949 case "side": 949 case "side":
950 plane = [1,0,0,0]; 950 plane = [1,0,0,0];
951 plane[3] = this.application.ninja.currentDocument.documentRoot.offsetWidth / 2.0; 951 plane[3] = this.application.ninja.currentDocument.model.documentRoot.offsetWidth / 2.0;
952 break; 952 break;
953 953
954 case "front": 954 case "front":
@@ -967,7 +967,7 @@ exports.Stage = Montage.create(Component, {
967 setStageView: { 967 setStageView: {
968 value: function(side) { 968 value: function(side) {
969 var mat, 969 var mat,
970 currentDoc = this.application.ninja.currentDocument.documentRoot, 970 currentDoc = this.application.ninja.currentDocument.model.documentRoot,
971 isDrawingGrid = this.application.ninja.appModel.show3dGrid; 971 isDrawingGrid = this.application.ninja.appModel.show3dGrid;
972 // Stage 3d Props. 972 // Stage 3d Props.
973 currentDoc.elementModel.props3D.ResetTranslationValues(); 973 currentDoc.elementModel.props3D.ResetTranslationValues();
diff --git a/js/stage/tool-handle.js b/js/stage/tool-handle.js
index 63cf30e5..70289512 100755
--- a/js/stage/tool-handle.js
+++ b/js/stage/tool-handle.js
@@ -243,7 +243,7 @@ exports.RotateHandle = Montage.create(ToolHandle, {
243 this._origin = pointOnElt; 243 this._origin = pointOnElt;
244 244
245 245
246 var viewMat = viewUtils.getMatrixFromElement(this.application.ninja.currentDocument.documentRoot); 246 var viewMat = viewUtils.getMatrixFromElement(this.application.ninja.currentDocument.model.documentRoot);
247 247
248 var transMat = viewMat.slice(0); 248 var transMat = viewMat.slice(0);
249 if(inLocalMode) 249 if(inLocalMode)
@@ -585,7 +585,7 @@ exports.TranslateHandle = Montage.create(ToolHandle, {
585 this._origin = pointOnElt; 585 this._origin = pointOnElt;
586 586
587 587
588 var stage = this.application.ninja.currentDocument.documentRoot; 588 var stage = this.application.ninja.currentDocument.model.documentRoot;
589 var viewMat = viewUtils.getMatrixFromElement(stage); 589 var viewMat = viewUtils.getMatrixFromElement(stage);
590 // Get viewMat without zoom value 590 // Get viewMat without zoom value
591 var zoom = this.application.ninja.documentBar.zoomFactor/100; 591 var zoom = this.application.ninja.documentBar.zoomFactor/100;