diff options
author | Jose Antonio Marquez | 2012-05-24 00:07:23 -0700 |
---|---|---|
committer | Jose Antonio Marquez | 2012-05-24 00:07:23 -0700 |
commit | 5914c5b2209c4b8daac4249bb76cda5c9314c4e6 (patch) | |
tree | f0910e57f64d1638f00bf7f6449d479fb377bfac /js/stage/stage.reel | |
parent | 16decc5726eafbb25675c61be6df85a378ac1fac (diff) | |
download | ninja-5914c5b2209c4b8daac4249bb76cda5c9314c4e6.tar.gz |
Cleaning up referencing to 'documentRoot' and '_document'
Moved to reference new model in DOM architecture rework. This should not affect anything, just moving the references, and also the setting to the render methods in the design view.
Diffstat (limited to 'js/stage/stage.reel')
-rwxr-xr-x | js/stage/stage.reel/stage.js | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js index 69cfa7ba..f3c096d8 100755 --- a/js/stage/stage.reel/stage.js +++ b/js/stage/stage.reel/stage.js | |||
@@ -189,7 +189,7 @@ exports.Stage = Montage.create(Component, { | |||
189 | set: function(value) { | 189 | set: function(value) { |
190 | this._userPaddingLeft = value; | 190 | this._userPaddingLeft = value; |
191 | this._documentOffsetLeft = -value; | 191 | this._documentOffsetLeft = -value; |
192 | this.application.ninja.currentDocument.documentRoot.ownerDocument.getElementsByTagName("HTML")[0].style["padding-left"] = -value + "px"; | 192 | this.application.ninja.currentDocument.model.documentRoot.ownerDocument.getElementsByTagName("HTML")[0].style["padding-left"] = -value + "px"; |
193 | this.userContentLeft = this._documentOffsetLeft; | 193 | this.userContentLeft = this._documentOffsetLeft; |
194 | this.updatedStage = true; | 194 | this.updatedStage = true; |
195 | } | 195 | } |
@@ -200,7 +200,7 @@ exports.Stage = Montage.create(Component, { | |||
200 | set: function(value) { | 200 | set: function(value) { |
201 | this._userPaddingTop = value; | 201 | this._userPaddingTop = value; |
202 | this._documentOffsetTop = -value; | 202 | this._documentOffsetTop = -value; |
203 | this.application.ninja.currentDocument.documentRoot.ownerDocument.getElementsByTagName("HTML")[0].style["padding-top"] = -value + "px"; | 203 | this.application.ninja.currentDocument.model.documentRoot.ownerDocument.getElementsByTagName("HTML")[0].style["padding-top"] = -value + "px"; |
204 | this.userContentTop = this._documentOffsetTop; | 204 | this.userContentTop = this._documentOffsetTop; |
205 | this.updatedStage = true; | 205 | this.updatedStage = true; |
206 | } | 206 | } |
@@ -283,8 +283,8 @@ exports.Stage = Montage.create(Component, { | |||
283 | this._userContentLeft = this._documentOffsetLeft; | 283 | this._userContentLeft = this._documentOffsetLeft; |
284 | this._userContentTop = this._documentOffsetTop; | 284 | this._userContentTop = this._documentOffsetTop; |
285 | 285 | ||
286 | this._maxHorizontalScroll = this.application.ninja.currentDocument.documentRoot.scrollWidth - this._canvas.width - 11; | 286 | this._maxHorizontalScroll = this.application.ninja.currentDocument.model.documentRoot.scrollWidth - this._canvas.width - 11; |
287 | this._maxVerticalScroll = this.application.ninja.currentDocument.documentRoot.scrollHeight - this._canvas.height - 11; | 287 | this._maxVerticalScroll = this.application.ninja.currentDocument.model.documentRoot.scrollHeight - this._canvas.height - 11; |
288 | this.application.ninja.currentDocument.model.views.design.iframe.contentWindow.addEventListener("scroll", this, false); | 288 | this.application.ninja.currentDocument.model.views.design.iframe.contentWindow.addEventListener("scroll", this, false); |
289 | 289 | ||
290 | // TODO - We will need to modify this once we support switching between multiple documents | 290 | // TODO - We will need to modify this once we support switching between multiple documents |
@@ -478,8 +478,8 @@ exports.Stage = Montage.create(Component, { | |||
478 | // TODO - scroll events are not dependable. We may need to use a timer to simulate | 478 | // TODO - scroll events are not dependable. We may need to use a timer to simulate |
479 | // scrollBegin and scrollEnd. For now, the Pan Tool will keep track of the stage's scroll values | 479 | // scrollBegin and scrollEnd. For now, the Pan Tool will keep track of the stage's scroll values |
480 | // on mouse down. | 480 | // on mouse down. |
481 | // this._maxHorizontalScroll = this.application.ninja.currentDocument.documentRoot.scrollWidth - this._canvas.width - 11; | 481 | // this._maxHorizontalScroll = this.application.ninja.currentDocument.model.documentRoot.scrollWidth - this._canvas.width - 11; |
482 | // this._maxVerticalScroll = this.application.ninja.currentDocument.documentRoot.scrollHeight - this._canvas.height - 11; | 482 | // this._maxVerticalScroll = this.application.ninja.currentDocument.model.documentRoot.scrollHeight - this._canvas.height - 11; |
483 | 483 | ||
484 | 484 | ||
485 | // Need to clear the snap cache and set up the drag plane | 485 | // Need to clear the snap cache and set up the drag plane |
@@ -517,9 +517,9 @@ exports.Stage = Montage.create(Component, { | |||
517 | */ | 517 | */ |
518 | centerStage: { | 518 | centerStage: { |
519 | value: function() { | 519 | value: function() { |
520 | if(this.application.ninja.currentDocument.documentRoot.id === "UserContent") { | 520 | if(this.application.ninja.currentDocument.model.documentRoot.id === "UserContent") { |
521 | this._iframeContainer.scrollLeft = this._documentOffsetLeft - (this._iframeContainer.offsetWidth - this.application.ninja.currentDocument.documentRoot.parentNode.offsetWidth)/2; | 521 | this._iframeContainer.scrollLeft = this._documentOffsetLeft - (this._iframeContainer.offsetWidth - this.application.ninja.currentDocument.model.documentRoot.parentNode.offsetWidth)/2; |
522 | this._iframeContainer.scrollTop = this._documentOffsetTop - (this._iframeContainer.offsetHeight - this.application.ninja.currentDocument.documentRoot.parentNode.offsetHeight)/2; | 522 | this._iframeContainer.scrollTop = this._documentOffsetTop - (this._iframeContainer.offsetHeight - this.application.ninja.currentDocument.model.documentRoot.parentNode.offsetHeight)/2; |
523 | 523 | ||
524 | this._scrollLeft = this._iframeContainer.scrollLeft; | 524 | this._scrollLeft = this._iframeContainer.scrollLeft; |
525 | this._scrollTop = this._iframeContainer.scrollTop; | 525 | this._scrollTop = this._iframeContainer.scrollTop; |
@@ -889,7 +889,7 @@ exports.Stage = Montage.create(Component, { | |||
889 | 889 | ||
890 | setStageAsViewport: { | 890 | setStageAsViewport: { |
891 | value: function() { | 891 | value: function() { |
892 | this.stageDeps.viewUtils.setViewportObj(this.application.ninja.currentDocument.documentRoot); | 892 | this.stageDeps.viewUtils.setViewportObj(this.application.ninja.currentDocument.model.documentRoot); |
893 | } | 893 | } |
894 | }, | 894 | }, |
895 | 895 | ||
@@ -897,7 +897,7 @@ exports.Stage = Montage.create(Component, { | |||
897 | value: function(value) { | 897 | value: function(value) { |
898 | if(!this._firstDraw) | 898 | if(!this._firstDraw) |
899 | { | 899 | { |
900 | var userContent = this.application.ninja.currentDocument.documentRoot; | 900 | var userContent = this.application.ninja.currentDocument.model.documentRoot; |
901 | if (userContent) | 901 | if (userContent) |
902 | { | 902 | { |
903 | var w = this._canvas.width, | 903 | var w = this._canvas.width, |
@@ -928,12 +928,12 @@ exports.Stage = Montage.create(Component, { | |||
928 | { | 928 | { |
929 | case "top": | 929 | case "top": |
930 | plane = [0,1,0,0]; | 930 | plane = [0,1,0,0]; |
931 | plane[3] = this.application.ninja.currentDocument.documentRoot.offsetHeight / 2.0; | 931 | plane[3] = this.application.ninja.currentDocument.model.documentRoot.offsetHeight / 2.0; |
932 | break; | 932 | break; |
933 | 933 | ||
934 | case "side": | 934 | case "side": |
935 | plane = [1,0,0,0]; | 935 | plane = [1,0,0,0]; |
936 | plane[3] = this.application.ninja.currentDocument.documentRoot.offsetWidth / 2.0; | 936 | plane[3] = this.application.ninja.currentDocument.model.documentRoot.offsetWidth / 2.0; |
937 | break; | 937 | break; |
938 | 938 | ||
939 | case "front": | 939 | case "front": |
@@ -952,7 +952,7 @@ exports.Stage = Montage.create(Component, { | |||
952 | setStageView: { | 952 | setStageView: { |
953 | value: function(side) { | 953 | value: function(side) { |
954 | var mat, | 954 | var mat, |
955 | currentDoc = this.application.ninja.currentDocument.documentRoot, | 955 | currentDoc = this.application.ninja.currentDocument.model.documentRoot, |
956 | isDrawingGrid = this.application.ninja.appModel.show3dGrid; | 956 | isDrawingGrid = this.application.ninja.appModel.show3dGrid; |
957 | // Stage 3d Props. | 957 | // Stage 3d Props. |
958 | currentDoc.elementModel.props3D.ResetTranslationValues(); | 958 | currentDoc.elementModel.props3D.ResetTranslationValues(); |