diff options
author | Ananya Sen | 2012-03-06 16:30:33 -0800 |
---|---|---|
committer | Ananya Sen | 2012-03-06 16:30:33 -0800 |
commit | 2364c671ffc2953e3ee8dfdf037244de8fab3920 (patch) | |
tree | dfdcc7d60b5d8627d6b41d0b37e66ad5cc75ba5b /js/controllers/selection-controller.js | |
parent | fbde30a4651d34ac569bf6750db5dd017ccc8d6e (diff) | |
download | ninja-2364c671ffc2953e3ee8dfdf037244de8fab3920.tar.gz |
IKNINJA-1238 fix and fixing other js errors on switching and closing documents
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/controllers/selection-controller.js')
-rwxr-xr-x | js/controllers/selection-controller.js | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js index 08eb018f..3f9d8514 100755 --- a/js/controllers/selection-controller.js +++ b/js/controllers/selection-controller.js | |||
@@ -91,15 +91,17 @@ exports.SelectionController = Montage.create(Component, { | |||
91 | 91 | ||
92 | handleSwitchDocument: { | 92 | handleSwitchDocument: { |
93 | value: function() { | 93 | value: function() { |
94 | this._selectedItems = this.application.ninja.selectedElements.slice(0); | 94 | if(this.application.ninja.documentController.activeDocument.currentView === "design"){ |
95 | if(this._selectedItems.length === 0 ){ | 95 | this._selectedItems = this.application.ninja.selectedElements.slice(0); |
96 | this._isDocument = true; | 96 | if(this._selectedItems.length === 0 ){ |
97 | }else{ | 97 | this._isDocument = true; |
98 | this._isDocument = false; | 98 | }else{ |
99 | } | 99 | this._isDocument = false; |
100 | NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} ); | 100 | } |
101 | NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} ); | ||
101 | 102 | ||
102 | this._selectionContainer = this.application.ninja.currentSelectedContainer; | 103 | this._selectionContainer = this.application.ninja.currentSelectedContainer; |
104 | } | ||
103 | } | 105 | } |
104 | }, | 106 | }, |
105 | 107 | ||