diff options
Diffstat (limited to 'js/helper-classes')
86 files changed, 7967 insertions, 21929 deletions
diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js index 59da411f..a5428ea3 100755 --- a/js/helper-classes/3D/draw-utils.js +++ b/js/helper-classes/3D/draw-utils.js | |||
@@ -109,10 +109,10 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, { | |||
109 | this._gridOrigin = [0,0]; // 2D plane space point | 109 | this._gridOrigin = [0,0]; // 2D plane space point |
110 | 110 | ||
111 | this.eventManager.addEventListener("elementAdded", this, false); | 111 | this.eventManager.addEventListener("elementAdded", this, false); |
112 | this.eventManager.addEventListener("elementDeleted", this, false); | 112 | this.eventManager.addEventListener("elementsRemoved", this, false); |
113 | this.eventManager.addEventListener("deleteSelection", this, false); | ||
114 | this.eventManager.addEventListener("elementChange", this, false); | 113 | this.eventManager.addEventListener("elementChange", this, false); |
115 | this.eventManager.addEventListener("closeDocument", this, false); | 114 | this.eventManager.addEventListener("closeDocument", this, false); |
115 | this.eventManager.addEventListener("elementReplaced", this, false); | ||
116 | } | 116 | } |
117 | }, | 117 | }, |
118 | 118 | ||
@@ -139,46 +139,83 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, { | |||
139 | handleCloseDocument:{ | 139 | handleCloseDocument:{ |
140 | value: function() { | 140 | value: function() { |
141 | if(this.application.ninja.documentController._documents.length === 0){ | 141 | if(this.application.ninja.documentController._documents.length === 0){ |
142 | this._eltArray = null; | 142 | this._eltArray.length = 0; |
143 | this._planesArray = null; | 143 | this._planesArray.length = 0; |
144 | } | 144 | } |
145 | } | 145 | } |
146 | }, | 146 | }, |
147 | 147 | ||
148 | handleElementAdded: { | 148 | handleElementAdded: { |
149 | value: function(event) { | 149 | value: function(event) { |
150 | this.addElement(event.detail); | 150 | var elements = event.detail; |
151 | |||
152 | if(Array.isArray(elements)) { | ||
153 | elements.forEach(function(element) { | ||
154 | this.addElement(element); | ||
155 | }, this); | ||
156 | } else { | ||
157 | this.addElement(elements); | ||
158 | } | ||
159 | |||
151 | this.drawWorkingPlane(); | 160 | this.drawWorkingPlane(); |
152 | } | 161 | } |
153 | }, | 162 | }, |
154 | 163 | ||
155 | handleElementDeleted: { | 164 | handleElementsRemoved: { |
156 | value: function(event) { | 165 | value: function(event) { |
157 | this.removeElement(event.detail); | 166 | var elements = event.detail; |
167 | |||
168 | if(Array.isArray(elements)) { | ||
169 | elements = Array.prototype.slice.call(elements, 0); | ||
170 | elements.forEach(function(element) { | ||
171 | this.removeElement(element); | ||
172 | }, this); | ||