diff options
author | Valerio Virgillito | 2012-05-31 10:27:46 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-05-31 10:27:46 -0700 |
commit | e1fe603a7c002073f8ac13623f8cc8dc43efb59d (patch) | |
tree | 38d9f7e00cc4a7b181ebe0029eaadcb46c70afb8 /js/panels | |
parent | 5b982abcfe51278062c06fde5fa7e5371f6aef54 (diff) | |
download | ninja-e1fe603a7c002073f8ac13623f8cc8dc43efb59d.tar.gz |
fixing selection when switching documents
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/panels')
-rwxr-xr-x | js/panels/properties.reel/properties.js | 26 |
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 = ""; |