From 7a9c2a91dfbbdd0cd7c79d81be5aeecd7887e7f1 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Wed, 29 Feb 2012 10:12:38 -0800 Subject: handle selections for switching documents Signed-off-by: Ananya Sen --- js/controllers/selection-controller.js | 6 +++++- js/panels/properties/content.reel/content.js | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js index 62313960..0f2a16e0 100755 --- a/js/controllers/selection-controller.js +++ b/js/controllers/selection-controller.js @@ -92,7 +92,11 @@ exports.SelectionController = Montage.create(Component, { handleSwitchDocument: { value: function() { this._selectedItems = this.application.ninja.selectedElements.slice(0); - this._isDocument = false; + if(this._selectedItems.length === 0){ + this._isDocument = true; + }else{ + this._isDocument = false; + } NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} ); } }, diff --git a/js/panels/properties/content.reel/content.js b/js/panels/properties/content.reel/content.js index e92fbcb2..fcd85675 100755 --- a/js/panels/properties/content.reel/content.js +++ b/js/panels/properties/content.reel/content.js @@ -81,6 +81,12 @@ exports.Content = Montage.create(Component, { // For now always assume that the stage is selected by default if(this.application.ninja.selectedElements.length === 0) { this.displayStageProperties(); + }else{ + if(this.application.ninja.selectedElements.length === 1) { + this.displayElementProperties(this.application.ninja.selectedElements[0]._element); + } else { + this.displayGroupProperties(this.application.ninja.selectedElements); + } } } }, -- cgit v1.2.3