aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-05-24 06:10:05 -0700
committerNivesh Rajbhandari2012-05-24 06:10:05 -0700
commit8fdf7567a7967208f554657c6c6d5665ab55e118 (patch)
tree79abd1c8ce529d8877e9457db8f359126d35f3ba
parentd874b959bc297fed31d3ef3c2a7c8c77df88f761 (diff)
downloadninja-8fdf7567a7967208f554657c6c6d5665ab55e118.tar.gz
Update stage to handle switching between documents.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
-rwxr-xr-xjs/stage/stage.reel/stage.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js
index a3903ac7..ad05f1cc 100755
--- a/js/stage/stage.reel/stage.js
+++ b/js/stage/stage.reel/stage.js
@@ -248,6 +248,7 @@ exports.Stage = Montage.create(Component, {
248 248
249 249
250 this.eventManager.addEventListener( "openDocument", this, false); 250 this.eventManager.addEventListener( "openDocument", this, false);
251 this.eventManager.addEventListener( "switchDocument", this, false);
251 this.eventManager.addEventListener( "enableStageMove", this, false); 252 this.eventManager.addEventListener( "enableStageMove", this, false);
252 this.eventManager.addEventListener( "disableStageMove", this, false); 253 this.eventManager.addEventListener( "disableStageMove", this, false);
253 254
@@ -261,6 +262,18 @@ exports.Stage = Montage.create(Component, {
261 // Event details will contain the active document prior to opening a new one 262 // Event details will contain the active document prior to opening a new one
262 handleOpenDocument: { 263 handleOpenDocument: {
263 value: function(evt) { 264 value: function(evt) {
265 this._initFromDocument(evt);
266 }
267 },
268
269 handleSwitchDocument: {
270 value: function(evt) {
271 this._initFromDocument(evt);
272 }
273 },
274
275 _initFromDocument: {
276 value: function(evt) {
264 var designView = this.application.ninja.currentDocument.model.views.design; 277 var designView = this.application.ninja.currentDocument.model.views.design;
265 278
266 this.hideCanvas(false); 279 this.hideCanvas(false);