aboutsummaryrefslogtreecommitdiff
path: root/js/stage
diff options
context:
space:
mode:
Diffstat (limited to 'js/stage')
-rwxr-xr-xjs/stage/stage-deps.js4
-rwxr-xr-xjs/stage/stage.reel/stage.js21
2 files changed, 15 insertions, 10 deletions
diff --git a/js/stage/stage-deps.js b/js/stage/stage-deps.js
index a71b77be..33ba2359 100755
--- a/js/stage/stage-deps.js
+++ b/js/stage/stage-deps.js
@@ -52,7 +52,7 @@ exports.StageDeps = Montage.create(Component, {
52 userContentLeft: { 52 userContentLeft: {
53 get: function() { return this._userContentLeft; }, 53 get: function() { return this._userContentLeft; },
54 set: function(value) { 54 set: function(value) {
55 if(value) { 55 if(value != null) {
56 viewUtils.setUserContentLeft(value); 56 viewUtils.setUserContentLeft(value);
57 } 57 }
58 } 58 }
@@ -65,7 +65,7 @@ exports.StageDeps = Montage.create(Component, {
65 userContentTop: { 65 userContentTop: {
66 get: function() { return this._userContentTop; }, 66 get: function() { return this._userContentTop; },
67 set: function(value) { 67 set: function(value) {
68 if(value) { 68 if(value != null) {
69 viewUtils.setUserContentTop(value); 69 viewUtils.setUserContentTop(value);
70 } 70 }
71 } 71 }
diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js
index dc6444ff..deed4112 100755
--- a/js/stage/stage.reel/stage.js
+++ b/js/stage/stage.reel/stage.js
@@ -387,9 +387,9 @@ exports.Stage = Montage.create(Component, {
387 handleMousewheel: { 387 handleMousewheel: {
388 value: function(event) { 388 value: function(event) {
389 if(event._event.wheelDelta > 0) { 389 if(event._event.wheelDelta > 0) {
390 this._iframeContainer.scrollTop -= 20; 390 this.application.ninja.currentDocument.model.views.design.document.body.scrollTop -= 20;
391 } else { 391 } else {
392 this._iframeContainer.scrollTop += 20; 392 this.application.ninja.currentDocument.model.views.design.document.body.scrollTop += 20;
393 } 393 }
394 } 394 }
395 }, 395 },
@@ -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