aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/selection-controller.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/controllers/selection-controller.js')
-rwxr-xr-xjs/controllers/selection-controller.js32
1 files changed, 1 insertions, 31 deletions
diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js
index 75bffc5c..848355da 100755
--- a/js/controllers/selection-controller.js
+++ b/js/controllers/selection-controller.js
@@ -20,9 +20,7 @@ exports.SelectionController = Montage.create(Component, {
20 } 20 }
21 }, 21 },
22 22
23 /* 23 // Bound property to the ninja currentSelectedContainer
24 * Bound property to the ninja currentSelectedContainer
25 */
26 _selectionContainer: { 24 _selectionContainer: {
27 value: null 25 value: null
28 }, 26 },
@@ -42,39 +40,11 @@ exports.SelectionController = Montage.create(Component, {
42 40
43 deserializedFromTemplate: { 41 deserializedFromTemplate: {
44 value: function() { 42 value: function() {
45 this.eventManager.addEventListener("openDocument", this, false);
46 this.eventManager.addEventListener("elementAdded", this, false); 43 this.eventManager.addEventListener("elementAdded", this, false);
47 this.eventManager.addEventListener("elementsRemoved", this, false); 44 this.eventManager.addEventListener("elementsRemoved", this, false);
48 this.eventManager.addEventListener("elementReplaced", this, false); 45 this.eventManager.addEventListener("elementReplaced", this, false);
49 this.eventManager.addEventListener("selectAll", this, false); 46 this.eventManager.addEventListener("selectAll", this, false);
50 this.eventManager.addEventListener("switchDocument", this, false); 47 this.eventManager.addEventListener("switchDocument", this, false);
51 this.eventManager.addEventListener("closeDocument", this, false);
52 }
53 },
54
55 /**
56 * Get the current document selection array. If nothing is selected the currentSelectionArray should be null
57 */
58 handleOpenDocument: {
59 value: function() {
60 // Handle initializing the selection array here.
61 this.initWithDocument([]);
62 }
63 },
64
65 initWithDocument: {
66 value: function(currentSelectionArray) {
67 this._isDocument = true;
68
69 if(currentSelectionArray) {
70 this.application.ninja.selectedElements = currentSelectionArray;
71 if(currentSelectionArray.length) {
72 this._isDocument = false;
73 NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument});
74 }
75 }
76
77 this._selectionContainer = this.application.ninja.currentSelectedContainer;
78 } 48 }
79 }, 49 },
80 50