aboutsummaryrefslogtreecommitdiff
path: root/js/stage
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-05-15 15:00:23 -0700
committerJose Antonio Marquez2012-05-15 15:00:23 -0700
commit73bd505354a94ebb19fa0b066b7b8467684bf8f0 (patch)
treeff90bd499b8e03c63b7673f4113e8b020efb6817 /js/stage
parent08935db8b1eca984bd384ef2b8db8ebba9e50091 (diff)
parentcdf00ba3e82c5064dd02ffa27f3069b4dd2e04c2 (diff)
downloadninja-73bd505354a94ebb19fa0b066b7b8467684bf8f0.tar.gz
Merge branch 'refs/heads/Ninja-DOM-Architecture' into Document
Diffstat (limited to 'js/stage')
-rwxr-xr-xjs/stage/stage.reel/stage.js17
1 files changed, 11 insertions, 6 deletions
diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js
index dc6444ff..e66c5b7b 100755
--- a/js/stage/stage.reel/stage.js
+++ b/js/stage/stage.reel/stage.js
@@ -464,8 +464,8 @@ exports.Stage = Montage.create(Component, {
464 this.userContentLeft = this._documentOffsetLeft - this._scrollLeft + this._userContentBorder; 464 this.userContentLeft = this._documentOffsetLeft - this._scrollLeft + this._userContentBorder;
465 this.userContentTop = this._documentOffsetTop - this._scrollTop + this._userContentBorder; 465 this.userContentTop = this._documentOffsetTop - this._scrollTop + this._userContentBorder;
466 } else { 466 } else {
467 this._scrollLeft = this.application.ninja.currentDocument.documentRoot.scrollLeft; 467 this._scrollLeft = this.application.ninja.currentDocument.model.views.design.document.body.scrollLeft;
468 this._scrollTop = this.application.ninja.currentDocument.documentRoot.scrollTop; 468 this._scrollTop = this.application.ninja.currentDocument.model.views.design.document.body.scrollTop;
469 469
470 this.userContentLeft = -this._scrollLeft; 470 this.userContentLeft = -this._scrollLeft;
471 this.userContentTop = -this._scrollTop; 471 this.userContentTop = -this._scrollTop;
@@ -512,11 +512,16 @@ exports.Stage = Montage.create(Component, {
512 */ 512 */
513 centerStage: { 513 centerStage: {
514 value: function() { 514 value: function() {
515 this._iframeContainer.scrollLeft = this._documentOffsetLeft - (this._iframeContainer.offsetWidth - this._documentRoot.parentNode.offsetWidth)/2; 515 if(this.application.ninja.currentDocument.documentRoot.id === "UserContent") {
516 this._iframeContainer.scrollTop = this._documentOffsetTop - (this._iframeContainer.offsetHeight - this._documentRoot.parentNode.offsetHeight)/2; 516 this._iframeContainer.scrollLeft = this._documentOffsetLeft - (this._iframeContainer.offsetWidth - this._documentRoot.parentNode.offsetWidth)/2;
517 this._iframeContainer.scrollTop = this._documentOffsetTop - (this._iframeContainer.offsetHeight - this._documentRoot.parentNode.offsetHeight)/2;
517 518
518 this._scrollLeft = this._iframeContainer.scrollLeft; 519 this._scrollLeft = this._iframeContainer.scrollLeft;
519 this._scrollTop = this._iframeContainer.scrollTop; 520 this._scrollTop = this._iframeContainer.scrollTop;
521 } else {
522 this._scrollLeft = this._userContentLeft = this.application.ninja.currentDocument.model.views.design.document.body.scrollLeft = 0;
523 this._scrollTop = this._userContentTop = this.application.ninja.currentDocument.model.views.design.document.body.scrollTop = 0;
524 }
520 } 525 }
521 }, 526 },
522 527