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.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js
index 9f6b9ed1..a401c363 100755
--- a/js/helper-classes/3D/snap-manager.js
+++ b/js/helper-classes/3D/snap-manager.js
@@ -124,6 +124,7 @@ var SnapManager = exports.SnapManager = Montage.create(Component, {
124 initialize: { 124 initialize: {
125 value: function() { 125 value: function() {
126 this.eventManager.addEventListener("elementsRemoved", this, false); 126 this.eventManager.addEventListener("elementsRemoved", this, false);
127 this.eventManager.addEventListener("elementReplaced", this, false);
127 } 128 }
128 }, 129 },
129 130
@@ -170,15 +171,19 @@ var SnapManager = exports.SnapManager = Montage.create(Component, {
170 if(Array.isArray(elements)) { 171 if(Array.isArray(elements)) {
171 elements = Array.prototype.slice.call(elements, 0); 172 elements = Array.prototype.slice.call(elements, 0);
172 elements.forEach(function(element) { 173 elements.forEach(function(element) {
173 element = element._element || element;
174 self.removeElementFrom2DCache(element); 174 self.removeElementFrom2DCache(element);
175 }); 175 });
176 } else { 176 } else {
177 this.removeElementFrom2DCache(elements._element || elements); 177 this.removeElementFrom2DCache(elements);
178 } 178 }
179 } 179 }
180 }, 180 },
181 181
182 handleElementReplaced: {
183 value: function(event) {
184 this._isCacheInvalid = true;
185 }
186 },
182 187
183 setCurrentStage: { 188 setCurrentStage: {
184 value: function(stage) { 189 value: function(stage) {