aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/selection-controller.js
diff options
context:
space:
mode:
authorAnanya Sen2012-02-28 15:15:27 -0800
committerAnanya Sen2012-02-28 15:15:27 -0800
commit5ab7efb9949e486395659c383064a08821febdae (patch)
tree69c91481dee42ab59dca874815d0d283bf52e8c4 /js/controllers/selection-controller.js
parent676b4e2d7091ac63ce06f51be686b902b940bfff (diff)
downloadninja-5ab7efb9949e486395659c383064a08821febdae.tar.gz
persist selections while switching documents
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/controllers/selection-controller.js')
-rwxr-xr-xjs/controllers/selection-controller.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js
index f50762f3..62313960 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,14 @@ 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 this._isDocument = false;
96 NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} );
97 }
98 },
99
91 handleElementAdded: { 100 handleElementAdded: {
92 value: function(event) { 101 value: function(event) {
93 this.executeSelectElement(event.detail); 102 this.executeSelectElement(event.detail);