aboutsummaryrefslogtreecommitdiff
path: root/js/panels
diff options
context:
space:
mode:
authorValerio Virgillito2012-05-31 10:27:46 -0700
committerValerio Virgillito2012-05-31 10:27:46 -0700
commite1fe603a7c002073f8ac13623f8cc8dc43efb59d (patch)
tree38d9f7e00cc4a7b181ebe0029eaadcb46c70afb8 /js/panels
parent5b982abcfe51278062c06fde5fa7e5371f6aef54 (diff)
downloadninja-e1fe603a7c002073f8ac13623f8cc8dc43efb59d.tar.gz
fixing selection when switching documents
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/panels')
-rwxr-xr-xjs/panels/properties.reel/properties.js26
1 files changed, 21 insertions, 5 deletions
diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js
index d05fb058..934a3851 100755
--- a/js/panels/properties.reel/properties.js
+++ b/js/panels/properties.reel/properties.js
@@ -28,15 +28,17 @@ exports.Properties = Montage.create(Component, {
28 28
29 this._currentDocument = value; 29 this._currentDocument = value;
30 30
31 if(!value) { 31// if(!value) {
32 this.clear(); 32 this.clear();
33 } else if(this._currentDocument.currentView === "design") { 33// }
34 // Save a reference of the pi inside the document view to be able to clear
35 this._currentDocument.model.views.design.propertiesPanel = this;
36 34
35 /*
36 else if(this._currentDocument.currentView === "design") {
37 // Display the default document root PI 37 // Display the default document root PI
38 this.displayElementProperties(this._currentDocument.model.documentRoot); 38 //this.displayElementProperties(this._currentDocument.model.documentRoot);
39// this.displaySelection(this._currentDocument.model.selection);
39 } 40 }
41 */
40 } 42 }
41 }, 43 },
42 44
@@ -181,6 +183,20 @@ exports.Properties = Montage.create(Component, {
181 } 183 }
182 }, 184 },
183 185
186 displaySelection: {
187 value: function(selection) {
188 if(selection.length === 0) {
189 this.displayElementProperties(this._currentDocument.model.documentRoot);
190 } else {
191 if(selection.length === 1) {
192 this.displayElementProperties(this.application.ninja.selectedElements[0]);
193 } else {
194 this.displayGroupProperties(this.application.ninja.selectedElements);
195 }
196 }
197 }
198 },
199
184 clear: { 200 clear: {
185 value: function() { 201 value: function() {
186 this.elementName.value = ""; 202 this.elementName.value = "";