From e1fe603a7c002073f8ac13623f8cc8dc43efb59d Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 31 May 2012 10:27:46 -0700 Subject: fixing selection when switching documents Signed-off-by: Valerio Virgillito --- js/ninja.reel/ninja.html | 4 +++- js/ninja.reel/ninja.js | 22 +--------------------- 2 files changed, 4 insertions(+), 22 deletions(-) (limited to 'js/ninja.reel') diff --git a/js/ninja.reel/ninja.html b/js/ninja.reel/ninja.html index d9bebc36..031d68e9 100755 --- a/js/ninja.reel/ninja.html +++ b/js/ninja.reel/ninja.html @@ -278,7 +278,9 @@ "selectionController": { "prototype": "js/controllers/selection-controller", "bindings" : { - "selectionContainer": {"<-": "@owner.currentSelectedContainer"} + "selectionContainer": {"<-": "@owner.currentSelectedContainer"}, + "currentDocument": {"<-": "@documentList.selectedObjects.0"}, + "selectedElements": {"<-": "@documentList.selectedObjects.0.model.selection"} } }, diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index 3c60bb41..4c1efff4 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -151,7 +151,6 @@ exports.Ninja = Montage.create(Component, { } }, - selectedElements: { value: [] }, @@ -196,7 +195,6 @@ exports.Ninja = Montage.create(Component, { this.eventManager.addEventListener("selectTool", this, false); this.eventManager.addEventListener("selectSubTool", this, false); - this.eventManager.addEventListener("onSwitchDocument", this, false); this.addPropertyChangeListener("appModel.livePreview", this.executeLivePreview, false); this.addPropertyChangeListener("appModel.chromePreview", this.executeChromePreview, false); @@ -311,15 +309,9 @@ exports.Ninja = Montage.create(Component, { this.currentSelectedContainer = doc.model.documentRoot; } -// if(this.currentDocument.model.documentRoot) { -// this.currentSelectedContainer = this.currentDocument.model.documentRoot; -// } else { -// alert("The current document has not loaded yet"); -// return; -// } // this.appModel.show3dGrid = this.currentDocument.draw3DGrid; -// NJevent("openDocument"); + } }, @@ -332,18 +324,6 @@ exports.Ninja = Montage.create(Component, { } }, - handleOnSwitchDocument: { - value: function() { - this.currentDocument = this.documentController.activeDocument; - - if(this.currentDocument.model.documentRoot) { - this._currentSelectedContainer = this.selectionController._selectionContainer = this.currentDocument.model.documentRoot; - } - - NJevent("switchDocument"); - } - }, - executeLivePreview: { value: function() { var background, overflow, transitionStopRule; -- cgit v1.2.3