aboutsummaryrefslogtreecommitdiff
path: root/js/stage/stage.reel
diff options
context:
space:
mode:
Diffstat (limited to 'js/stage/stage.reel')
-rwxr-xr-x[-rw-r--r--]js/stage/stage.reel/stage.css0
-rwxr-xr-x[-rw-r--r--]js/stage/stage.reel/stage.html14
-rwxr-xr-x[-rw-r--r--]js/stage/stage.reel/stage.js43
3 files changed, 44 insertions, 13 deletions
diff --git a/js/stage/stage.reel/stage.css b/js/stage/stage.reel/stage.css
index 54b9761b..54b9761b 100644..100755
--- a/js/stage/stage.reel/stage.css
+++ b/js/stage/stage.reel/stage.css
diff --git a/js/stage/stage.reel/stage.html b/js/stage/stage.reel/stage.html
index 623c54b8..812e3d55 100644..100755
--- a/js/stage/stage.reel/stage.html
+++ b/js/stage/stage.reel/stage.html
@@ -11,6 +11,14 @@
11 11
12 <script type="text/montage-serialization"> 12 <script type="text/montage-serialization">
13 { 13 {
14 "stageView" : {
15 "module": "js/stage/stage-view.reel",
16 "name": "StageView",
17 "properties": {
18 "element": {"#": "stageView"}
19 }
20 },
21
14 "StageDeps1": { 22 "StageDeps1": {
15 "module": "js/stage/stage-deps", 23 "module": "js/stage/stage-deps",
16 "name": "StageDeps", 24 "name": "StageDeps",
@@ -49,12 +57,12 @@
49 "properties": { 57 "properties": {
50 "element": {"#": "stageAndScenesContainer"}, 58 "element": {"#": "stageAndScenesContainer"},
51 "_iframeContainer": {"#": "iframeContainer"}, 59 "_iframeContainer": {"#": "iframeContainer"},
52 "codeViewContainer": {"#": "codeViewContainer"},
53 "_layoutCanvas": {"#": "layoutCanvas"}, 60 "_layoutCanvas": {"#": "layoutCanvas"},
54 "_canvas": {"#": "stageCanvas"}, 61 "_canvas": {"#": "stageCanvas"},
55 "_drawingCanvas": {"#": "drawingCanvas"}, 62 "_drawingCanvas": {"#": "drawingCanvas"},
56 "stageDeps": {"@": "StageDeps1"}, 63 "stageDeps": {"@": "StageDeps1"},
57 "layout": {"@": "layout1"}, 64 "layout": {"@": "layout1"},
65 "stageView": {"@": "stageView"},
58 "textTool": {"@": "textTool"} 66 "textTool": {"@": "textTool"}
59 }, 67 },
60 "bindings": { 68 "bindings": {
@@ -72,9 +80,9 @@
72<body> 80<body>
73 81
74 <section id="stageAndScenesContainer" class="stageAndScenesContainer"> 82 <section id="stageAndScenesContainer" class="stageAndScenesContainer">
83 <section id="stageView"></section>
75 <section id="iframeContainer"></section> 84 <section id="iframeContainer"></section>
76 <section id="textToolObject">asdasd asd asd asd asd asd </section> 85 <section id="textToolObject"></section>
77 <section id="codeViewContainer"></section>
78 <canvas id="layoutCanvas"></canvas> 86 <canvas id="layoutCanvas"></canvas>
79 <canvas id="stageCanvas"></canvas> 87 <canvas id="stageCanvas"></canvas>
80 <canvas id="drawingCanvas"></canvas> 88 <canvas id="drawingCanvas"></canvas>
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
7var Montage = require("montage/core/core").Montage, 7var 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,
10var drawUtils = require("js/helper-classes/3D/draw-utils").DrawUtils; 10 vecUtils = require("js/helper-classes/3D/vec-utils").VecUtils;
11var vecUtils = require("js/helper-classes/3D/vec-utils").VecUtils;
12 11
13exports.Stage = Montage.create(Component, { 12exports.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