aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/3D/snap-manager.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/helper-classes/3D/snap-manager.js')
-rwxr-xr-xjs/helper-classes/3D/snap-manager.js16
1 files changed, 13 insertions, 3 deletions
diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js
index 5b467b41..67dedc49 100755
--- a/js/helper-classes/3D/snap-manager.js
+++ b/js/helper-classes/3D/snap-manager.js
@@ -123,7 +123,7 @@ var SnapManager = exports.SnapManager = Montage.create(Component, {
123 /////////////////////////////////////////////////////////////////////// 123 ///////////////////////////////////////////////////////////////////////
124 initialize: { 124 initialize: {
125 value: function() { 125 value: function() {
126 this.eventManager.addEventListener("elementDeleted", this, false); 126 this.eventManager.addEventListener("elementsRemoved", this, false);
127 } 127 }
128 }, 128 },
129 129
@@ -163,9 +163,19 @@ var SnapManager = exports.SnapManager = Montage.create(Component, {
163 }, 163 },
164 164
165 165
166 handleElementDeleted: { 166 handleElementsRemoved: {
167 value: function(event) { 167 value: function(event) {
168 this.removeElementFrom2DCache(event.detail); 168 var self = this, elements = event.detail;
169
170 if(Array.isArray(elements)) {
171 elements = Array.prototype.slice.call(elements, 0);
172 elements.forEach(function(element) {
173 element = element._element || element;
174 self.removeElementFrom2DCache(element);
175 });
176 } else {
177 this.removeElementFrom2DCache(elements._element || elements);
178 }
169 } 179 }
170 }, 180 },
171 181