diff options
author | Nivesh Rajbhandari | 2012-02-20 11:14:44 -0800 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-02-20 11:14:44 -0800 |
commit | abf78e2d7a97d295ce5a1c425fd359d47379137e (patch) | |
tree | d08c91bd2aef31e6325e0b499b2ffc390018bec6 /js/stage/stage.reel/stage.js | |
parent | e80a79bff57fecf3aa9b869d8ed2de5fd815287c (diff) | |
parent | e23708721a71ca4c71365f5f8e8ac7d6113926db (diff) | |
download | ninja-abf78e2d7a97d295ce5a1c425fd359d47379137e.tar.gz |
Merge branch 'refs/heads/ninja-internal' into ToolFixes
Diffstat (limited to 'js/stage/stage.reel/stage.js')
-rwxr-xr-x[-rw-r--r--] | js/stage/stage.reel/stage.js | 43 |
1 files changed, 33 insertions, 10 deletions
diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js index 9cf97e09..6a8afad4 100644..100755 --- a/js/stage/stage.reel/stage.js +++ b/js/stage/stage.reel/stage.js | |||
@@ -4,15 +4,13 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | 4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. |
5 | </copyright> */ | 5 | </copyright> */ |
6 | 6 | ||
7 | var Montage = require("montage/core/core").Montage, | 7 | var Montage = require("montage/core/core").Montage, |
8 | Component = require("montage/ui/component").Component; | 8 | Component = require("montage/ui/component").Component, |
9 | 9 | drawUtils = require("js/helper-classes/3D/draw-utils").DrawUtils, | |
10 | var drawUtils = require("js/helper-classes/3D/draw-utils").DrawUtils; | 10 | vecUtils = require("js/helper-classes/3D/vec-utils").VecUtils; |
11 | var vecUtils = require("js/helper-classes/3D/vec-utils").VecUtils; | ||
12 | 11 | ||
13 | exports.Stage = Montage.create(Component, { | 12 | exports.Stage = Montage.create(Component, { |
14 | 13 | ||
15 | textTool: { value: null }, | ||
16 | // TODO - Need to figure out how to remove this dependency | 14 | // TODO - Need to figure out how to remove this dependency |
17 | // Needed by some tools that depend on selectionDrawn event to set up some logic | 15 | // Needed by some tools that depend on selectionDrawn event to set up some logic |
18 | drawNow: { value : false }, | 16 | drawNow: { value : false }, |
@@ -117,9 +115,6 @@ exports.Stage = Montage.create(Component, { | |||
117 | _userContentLeft: { value: 0 }, | 115 | _userContentLeft: { value: 0 }, |
118 | _userContentTop: { value: 0 }, | 116 | _userContentTop: { value: 0 }, |
119 | _userContentBorder: { value: 0 }, | 117 | _userContentBorder: { value: 0 }, |
120 | savedLeftScroll: { value: null }, | ||
121 | savedTopScroll: { value: null }, | ||
122 | |||
123 | 118 | ||
124 | documentRoot: { | 119 | documentRoot: { |
125 | get: function () { return this._documentRoot; }, | 120 | get: function () { return this._documentRoot; }, |
@@ -206,6 +201,7 @@ exports.Stage = Montage.create(Component, { | |||
206 | this._drawingCanvas.addEventListener("mousedown", this, false); | 201 | this._drawingCanvas.addEventListener("mousedown", this, false); |
207 | this._drawingCanvas.addEventListener("mouseup", this, false); | 202 | this._drawingCanvas.addEventListener("mouseup", this, false); |
208 | this._drawingCanvas.addEventListener("dblclick", this, false); | 203 | this._drawingCanvas.addEventListener("dblclick", this, false); |
204 | this._drawingCanvas.addEventListener("mousewheel", this, false); | ||
209 | 205 | ||
210 | // Hide the canvas | 206 | // Hide the canvas |
211 | this.hideCanvas(true); | 207 | this.hideCanvas(true); |
@@ -248,6 +244,8 @@ exports.Stage = Montage.create(Component, { | |||
248 | 244 | ||
249 | this._scrollLeft = this._iframeContainer.scrollLeft; | 245 | this._scrollLeft = this._iframeContainer.scrollLeft; |
250 | this._scrollTop = this._iframeContainer.scrollTop; | 246 | this._scrollTop = this._iframeContainer.scrollTop; |
247 | this.application.ninja.currentDocument.savedLeftScroll = this._iframeContainer.scrollLeft; | ||
248 | this.application.ninja.currentDocument.savedTopScroll = this._iframeContainer.scrollTop; | ||
251 | 249 | ||
252 | this.userContentBorder = parseInt(this._documentRoot.elementModel.controller.getProperty(this._documentRoot, "border")); | 250 | this.userContentBorder = parseInt(this._documentRoot.elementModel.controller.getProperty(this._documentRoot, "border")); |
253 | 251 | ||
@@ -363,6 +361,16 @@ exports.Stage = Montage.create(Component, { | |||
363 | } | 361 | } |
364 | }, | 362 | }, |
365 | 363 | ||
364 | handleMousewheel: { | ||
365 | value: function(event) { | ||
366 | if(event._event.wheelDelta > 0) { | ||
367 | this._iframeContainer.scrollTop -= 20; | ||
368 | } else { | ||
369 | this._iframeContainer.scrollTop += 20; | ||
370 | } | ||
371 | } | ||
372 | }, | ||
373 | |||
366 | /** | 374 | /** |
367 | * Enables the MouseMove on Canvas | 375 | * Enables the MouseMove on Canvas |
368 | */ | 376 | */ |
@@ -908,5 +916,20 @@ exports.Stage = Montage.create(Component, { | |||
908 | 916 | ||
909 | this.stageDeps.snapManager.updateWorkingPlaneFromView(); | 917 | this.stageDeps.snapManager.updateWorkingPlaneFromView(); |
910 | } | 918 | } |
911 | } | 919 | }, |
920 | |||
921 | saveScroll:{ | ||
922 | value: function(){ | ||
923 | this.application.ninja.documentController.activeDocument.savedLeftScroll = this._iframeContainer.scrollLeft; | ||
924 | this.application.ninja.documentController.activeDocument.savedTopScroll = this._iframeContainer.scrollTop; | ||
925 | } | ||
926 | }, | ||
927 | restoreScroll:{ | ||
928 | value: function(){ | ||
929 | this._iframeContainer.scrollLeft = this.application.ninja.documentController.activeDocument.savedLeftScroll; | ||
930 | this._scrollLeft = this.application.ninja.documentController.activeDocument.savedLeftScroll; | ||
931 | this._iframeContainer.scrollTop = this.application.ninja.documentController.activeDocument.savedTopScroll; | ||
932 | this._scrollTop = this.application.ninja.documentController.activeDocument.savedTopScroll; | ||
933 | } | ||
934 | } | ||
912 | }); \ No newline at end of file | 935 | }); \ No newline at end of file |