From 7a94696e19b14e15261df516e2ba75e693b1313d Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 18 May 2012 00:21:56 -0700 Subject: enabling basic document switching Signed-off-by: Valerio Virgillito --- js/ninja.reel/ninja.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'js/ninja.reel/ninja.js') diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index 9f0456ae..ba87e2d5 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -161,9 +161,10 @@ exports.Ninja = Montage.create(Component, { window.addEventListener("resize", this, false); - this.eventManager.addEventListener( "selectTool", this, false); - this.eventManager.addEventListener( "selectSubTool", this, false); - this.eventManager.addEventListener( "onOpenDocument", this, false); + this.eventManager.addEventListener("selectTool", this, false); + this.eventManager.addEventListener("selectSubTool", this, false); + this.eventManager.addEventListener("onOpenDocument", this, false); + this.eventManager.addEventListener("switchDocument", this, false); this.addPropertyChangeListener("appModel.livePreview", this.executeLivePreview, false); this.addPropertyChangeListener("appModel.chromePreview", this.executeChromePreview, false); @@ -279,6 +280,16 @@ exports.Ninja = Montage.create(Component, { } }, + handleSwitchDocument: { + value: function() { + this.currentDocument = this.documentController.activeDocument; + + if(this.currentDocument.documentRoot) { + this.application.ninja.currentSelectedContainer = this.currentDocument.documentRoot; + } + } + }, + executeLivePreview: { value: function() { var background, overflow, transitionStopRule; -- cgit v1.2.3