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/tools/PanTool.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'js/tools') diff --git a/js/tools/PanTool.js b/js/tools/PanTool.js index 132ac0b1..5cfeec75 100755 --- a/js/tools/PanTool.js +++ b/js/tools/PanTool.js @@ -148,8 +148,7 @@ exports.PanTool = Montage.create(toolBase, delta = 10*event.wheelDelta/120; //console.log( "delta: " + delta ); - this.application.ninja.currentDocument.documentRoot.scrollLeft += delta; -// this.application.ninja.stage._scrollLeft += delta; + this.application.ninja.currentDocument.model.views.design.document.body.scrollLeft += delta; delta *= zoom; @@ -330,8 +329,8 @@ exports.PanTool = Montage.create(toolBase, var limitX = false; var limitY = false; - var oldLeft = this.application.ninja.currentDocument.documentRoot.scrollLeft, - oldTop = this.application.ninja.currentDocument.documentRoot.scrollTop, + var oldLeft = this.application.ninja.currentDocument.model.views.design.document.body.scrollLeft, + oldTop = this.application.ninja.currentDocument.model.views.design.document.body.scrollTop, newLeft = oldLeft - deltaGPt[0], newTop = oldTop - deltaGPt[1]; if((newLeft < 0) || (newLeft > this._maxHorizontalScroll)) @@ -342,10 +341,10 @@ exports.PanTool = Montage.create(toolBase, { limitY = true; } - this.application.ninja.currentDocument.documentRoot.scrollLeft -= deltaGPt[0]; - this.application.ninja.currentDocument.documentRoot.scrollTop -= deltaGPt[1]; - deltaGPt[0] = oldLeft - this.application.ninja.currentDocument.documentRoot.scrollLeft; - deltaGPt[1] = oldTop - this.application.ninja.currentDocument.documentRoot.scrollTop; + this.application.ninja.currentDocument.model.views.design.document.body.scrollLeft -= deltaGPt[0]; + this.application.ninja.currentDocument.model.views.design.document.body.scrollTop -= deltaGPt[1]; + deltaGPt[0] = oldLeft - this.application.ninja.currentDocument.model.views.design.document.body.scrollLeft; + deltaGPt[1] = oldTop - this.application.ninja.currentDocument.model.views.design.document.body.scrollTop; gPt[0] -= deltaGPt[0]; gPt[1] -= deltaGPt[1]; -- cgit v1.2.3