diff options
author | Valerio Virgillito | 2012-05-15 14:50:02 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-05-15 14:50:02 -0700 |
commit | cdf00ba3e82c5064dd02ffa27f3069b4dd2e04c2 (patch) | |
tree | 222d7939f0ac4863b13fae288aa5c0a8da862749 /js/tools/PanTool.js | |
parent | 1d72a82a4c27a288e900eab99818222159ef8e23 (diff) | |
parent | d8c7c8959f330c3a153aac65197cce54172275fc (diff) | |
download | ninja-cdf00ba3e82c5064dd02ffa27f3069b4dd2e04c2.tar.gz |
Merge pull request #233 from mqg734/Dom-Architecture
Fixing scrollbar syncing, including pan tool, for banner templates.
Diffstat (limited to 'js/tools/PanTool.js')
-rwxr-xr-x | js/tools/PanTool.js | 15 |
1 files changed, 7 insertions, 8 deletions
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, | |||
148 | delta = 10*event.wheelDelta/120; | 148 | delta = 10*event.wheelDelta/120; |
149 | //console.log( "delta: " + delta ); | 149 | //console.log( "delta: " + delta ); |
150 | 150 | ||
151 | this.application.ninja.currentDocument.documentRoot.scrollLeft += delta; | 151 | this.application.ninja.currentDocument.model.views.design.document.body.scrollLeft += delta; |
152 | // this.application.ninja.stage._scrollLeft += delta; | ||
153 | 152 | ||
154 | delta *= zoom; | 153 | delta *= zoom; |
155 | 154 | ||
@@ -330,8 +329,8 @@ exports.PanTool = Montage.create(toolBase, | |||
330 | var limitX = false; | 329 | var limitX = false; |
331 | var limitY = false; | 330 | var limitY = false; |
332 | 331 | ||
333 | var oldLeft = this.application.ninja.currentDocument.documentRoot.scrollLeft, | 332 | var oldLeft = this.application.ninja.currentDocument.model.views.design.document.body.scrollLeft, |
334 | oldTop = this.application.ninja.currentDocument.documentRoot.scrollTop, | 333 | oldTop = this.application.ninja.currentDocument.model.views.design.document.body.scrollTop, |
335 | newLeft = oldLeft - deltaGPt[0], | 334 | newLeft = oldLeft - deltaGPt[0], |
336 | newTop = oldTop - deltaGPt[1]; | 335 | newTop = oldTop - deltaGPt[1]; |
337 | if((newLeft < 0) || (newLeft > this._maxHorizontalScroll)) | 336 | if((newLeft < 0) || (newLeft > this._maxHorizontalScroll)) |
@@ -342,10 +341,10 @@ exports.PanTool = Montage.create(toolBase, | |||
342 | { | 341 | { |
343 | limitY = true; | 342 | limitY = true; |
344 | } | 343 | } |
345 | this.application.ninja.currentDocument.documentRoot.scrollLeft -= deltaGPt[0]; | 344 | this.application.ninja.currentDocument.model.views.design.document.body.scrollLeft -= deltaGPt[0]; |
346 | this.application.ninja.currentDocument.documentRoot.scrollTop -= deltaGPt[1]; | 345 | this.application.ninja.currentDocument.model.views.design.document.body.scrollTop -= deltaGPt[1]; |
347 | deltaGPt[0] = oldLeft - this.application.ninja.currentDocument.documentRoot.scrollLeft; | 346 | deltaGPt[0] = oldLeft - this.application.ninja.currentDocument.model.views.design.document.body.scrollLeft; |
348 | deltaGPt[1] = oldTop - this.application.ninja.currentDocument.documentRoot.scrollTop; | 347 | deltaGPt[1] = oldTop - this.application.ninja.currentDocument.model.views.design.document.body.scrollTop; |
349 | 348 | ||
350 | gPt[0] -= deltaGPt[0]; | 349 | gPt[0] -= deltaGPt[0]; |
351 | gPt[1] -= deltaGPt[1]; | 350 | gPt[1] -= deltaGPt[1]; |