From 253b8803c71c88a6f87fb1caccd42fa081fc6eca Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 15 May 2012 14:17:41 -0700 Subject: Fixing scrollbar syncing, including pan tool, for banner templates. Signed-off-by: Nivesh Rajbhandari --- js/stage/stage.reel/stage.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'js/stage/stage.reel') 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, { this.userContentLeft = this._documentOffsetLeft - this._scrollLeft + this._userContentBorder; this.userContentTop = this._documentOffsetTop - this._scrollTop + this._userContentBorder; } else { - this._scrollLeft = this.application.ninja.currentDocument.documentRoot.scrollLeft; - this._scrollTop = this.application.ninja.currentDocument.documentRoot.scrollTop; + this._scrollLeft = this.application.ninja.currentDocument.model.views.design.document.body.scrollLeft; + this._scrollTop = this.application.ninja.currentDocument.model.views.design.document.body.scrollTop; this.userContentLeft = -this._scrollLeft; this.userContentTop = -this._scrollTop; @@ -512,11 +512,16 @@ exports.Stage = Montage.create(Component, { */ centerStage: { value: function() { - this._iframeContainer.scrollLeft = this._documentOffsetLeft - (this._iframeContainer.offsetWidth - this._documentRoot.parentNode.offsetWidth)/2; - this._iframeContainer.scrollTop = this._documentOffsetTop - (this._iframeContainer.offsetHeight - this._documentRoot.parentNode.offsetHeight)/2; + if(this.application.ninja.currentDocument.documentRoot.id === "UserContent") { + this._iframeContainer.scrollLeft = this._documentOffsetLeft - (this._iframeContainer.offsetWidth - this._documentRoot.parentNode.offsetWidth)/2; + this._iframeContainer.scrollTop = this._documentOffsetTop - (this._iframeContainer.offsetHeight - this._documentRoot.parentNode.offsetHeight)/2; - this._scrollLeft = this._iframeContainer.scrollLeft; - this._scrollTop = this._iframeContainer.scrollTop; + this._scrollLeft = this._iframeContainer.scrollLeft; + this._scrollTop = this._iframeContainer.scrollTop; + } else { + this._scrollLeft = this._userContentLeft = this.application.ninja.currentDocument.model.views.design.document.body.scrollLeft = 0; + this._scrollTop = this._userContentTop = this.application.ninja.currentDocument.model.views.design.document.body.scrollTop = 0; + } } }, -- cgit v1.2.3 From 94855a2c1074f67f158b94ca0d61c51ee46c51b5 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 15 May 2012 16:08:37 -0700 Subject: fixed the mouse wheel scroll Signed-off-by: Valerio Virgillito --- js/stage/stage.reel/stage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/stage/stage.reel') diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js index e66c5b7b..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, { handleMousewheel: { value: function(event) { if(event._event.wheelDelta > 0) { - this._iframeContainer.scrollTop -= 20; + this.application.ninja.currentDocument.model.views.design.document.body.scrollTop -= 20; } else { - this._iframeContainer.scrollTop += 20; + this.application.ninja.currentDocument.model.views.design.document.body.scrollTop += 20; } } }, -- cgit v1.2.3