From 8fdf7567a7967208f554657c6c6d5665ab55e118 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 24 May 2012 06:10:05 -0700 Subject: Update stage to handle switching between documents. Signed-off-by: Nivesh Rajbhandari --- js/stage/stage.reel/stage.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'js') 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, { this.eventManager.addEventListener( "openDocument", this, false); + this.eventManager.addEventListener( "switchDocument", this, false); this.eventManager.addEventListener( "enableStageMove", this, false); this.eventManager.addEventListener( "disableStageMove", this, false); @@ -260,6 +261,18 @@ exports.Stage = Montage.create(Component, { // Event details will contain the active document prior to opening a new one handleOpenDocument: { + value: function(evt) { + this._initFromDocument(evt); + } + }, + + handleSwitchDocument: { + value: function(evt) { + this._initFromDocument(evt); + } + }, + + _initFromDocument: { value: function(evt) { var designView = this.application.ninja.currentDocument.model.views.design; -- cgit v1.2.3