diff options
author | Pushkar Joshi | 2012-03-02 12:36:34 -0800 |
---|---|---|
committer | Pushkar Joshi | 2012-03-02 12:36:34 -0800 |
commit | dc3c813320c8d3fb837d5d18e70ab35a53b116c1 (patch) | |
tree | da417684de5e302d302ea617854015bd9a8ca17a /js/controllers/selection-controller.js | |
parent | d7d78d4a4e8cf82c56379d25efbe679b3b823abc (diff) | |
parent | 4419209a1fd850ab468209b562b66b0242b42a9c (diff) | |
download | ninja-dc3c813320c8d3fb837d5d18e70ab35a53b116c1.tar.gz |
Merge branch 'brushtool' into pentool
Diffstat (limited to 'js/controllers/selection-controller.js')
-rwxr-xr-x | js/controllers/selection-controller.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js index f50762f3..c4623d3f 100755 --- a/js/controllers/selection-controller.js +++ b/js/controllers/selection-controller.js | |||
@@ -47,6 +47,7 @@ exports.SelectionController = Montage.create(Component, { | |||
47 | this.eventManager.addEventListener("elementDeleted", this, false); | 47 | this.eventManager.addEventListener("elementDeleted", this, false); |
48 | this.eventManager.addEventListener("selectAll", this, false); | 48 | this.eventManager.addEventListener("selectAll", this, false); |
49 | this.eventManager.addEventListener("deleteSelection", this, false); | 49 | this.eventManager.addEventListener("deleteSelection", this, false); |
50 | this.eventManager.addEventListener("switchDocument", this, false); | ||
50 | // defaultEventManager.addEventListener( "undo", this, false); | 51 | // defaultEventManager.addEventListener( "undo", this, false); |
51 | // defaultEventManager.addEventListener( "redo", this, false); | 52 | // defaultEventManager.addEventListener( "redo", this, false); |
52 | } | 53 | } |
@@ -88,6 +89,18 @@ exports.SelectionController = Montage.create(Component, { | |||
88 | } | 89 | } |
89 | }, | 90 | }, |
90 | 91 | ||
92 | handleSwitchDocument: { | ||
93 | value: function() { | ||
94 | this._selectedItems = this.application.ninja.selectedElements.slice(0); | ||
95 | if(this._selectedItems.length === 0 ){ | ||
96 | this._isDocument = true; | ||
97 | }else{ | ||
98 | this._isDocument = false; | ||
99 | } | ||
100 | NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} ); | ||
101 | } | ||
102 | }, | ||
103 | |||
91 | handleElementAdded: { | 104 | handleElementAdded: { |
92 | value: function(event) { | 105 | value: function(event) { |
93 | this.executeSelectElement(event.detail); | 106 | this.executeSelectElement(event.detail); |