From 5ab7efb9949e486395659c383064a08821febdae Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Tue, 28 Feb 2012 15:15:27 -0800 Subject: persist selections while switching documents Signed-off-by: Ananya Sen --- js/panels/properties/content.reel/content.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'js/panels/properties/content.reel/content.js') diff --git a/js/panels/properties/content.reel/content.js b/js/panels/properties/content.reel/content.js index 8fa33a75..9b9b7108 100755 --- a/js/panels/properties/content.reel/content.js +++ b/js/panels/properties/content.reel/content.js @@ -55,6 +55,7 @@ exports.Content = Montage.create(Component, { } this.eventManager.addEventListener("openDocument", this, false); + this.eventManager.addEventListener("switchDocument", this, false); } }, @@ -74,6 +75,15 @@ exports.Content = Montage.create(Component, { } }, + handleSwitchDocument: { + value: function(){ + // For now always assume that the stage is selected by default + if(this.application.ninja.selectedElements.length === 0) { + this.displayStageProperties(); + } + } + }, + /** * Blur and Key up to handle change in the Element ID field. */ -- cgit v1.2.3 From 557c4d3100ccde51b925b71f0650b2c783a4a042 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Tue, 28 Feb 2012 16:02:15 -0800 Subject: minor fix for handling selections on switch document Signed-off-by: Ananya Sen --- js/panels/properties/content.reel/content.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'js/panels/properties/content.reel/content.js') diff --git a/js/panels/properties/content.reel/content.js b/js/panels/properties/content.reel/content.js index 9b9b7108..cc9ec96a 100755 --- a/js/panels/properties/content.reel/content.js +++ b/js/panels/properties/content.reel/content.js @@ -80,6 +80,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 From 209e0781e926212bbaaad9e8ca4b61a0c389b30f Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 28 Feb 2012 17:19:42 -0800 Subject: We need to remove color buttons from the color model when updating the PI for selection change. Signed-off-by: Nivesh Rajbhandari --- js/panels/properties/content.reel/content.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'js/panels/properties/content.reel/content.js') diff --git a/js/panels/properties/content.reel/content.js b/js/panels/properties/content.reel/content.js index 8fa33a75..58c37db4 100755 --- a/js/panels/properties/content.reel/content.js +++ b/js/panels/properties/content.reel/content.js @@ -156,6 +156,17 @@ exports.Content = Montage.create(Component, { this.positionSize.widthSize = parseFloat(ElementsMediator.getProperty(stage, "width")); if(this.customPi !== stage.elementModel.pi) { + // We need to unregister color chips from the previous selection from the Color Model + var len = this.customSections.length; + for(var n = 0, controls; n < len; n++) { + controls = this.customSections[n].content.controls; + if(controls["colorSelect"]) { + controls["colorSelect"].destroy(); + } else if(controls["stageBackground"]) { + controls["stageBackground"].destroy(); + } + } + this.customPi = stage.elementModel.pi; this.displayCustomProperties(stage, stage.elementModel.pi); } @@ -221,6 +232,17 @@ exports.Content = Montage.create(Component, { // Custom Section if(this.customPi !== el.elementModel.pi) { + // We need to unregister color chips from the previous selection from the Color Model + var len = this.customSections.length; + for(var n = 0, controls; n < len; n++) { + controls = this.customSections[n].content.controls; + if(controls["colorSelect"]) { + controls["colorSelect"].destroy(); + } else if(controls["stageBackground"]) { + controls["stageBackground"].destroy(); + } + } + this.customPi = el.elementModel.pi; this.displayCustomProperties(el, el.elementModel.pi); } -- cgit v1.2.3