diff options
author | Nivesh Rajbhandari | 2012-04-16 16:06:24 -0700 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-04-16 16:06:24 -0700 |
commit | c253192a08b499ea7be46fa5438d273e51f7ec5a (patch) | |
tree | 18a1f0e3679c0eb993a9dedb537035d3861f49ac /js/helper-classes | |
parent | e19376c54eedd1f1c457ba405b2f110be376a559 (diff) | |
parent | 4b900ea5cd6bb77eb30cec8c03b9ec9fa662c1e9 (diff) | |
download | ninja-c253192a08b499ea7be46fa5438d273e51f7ec5a.tar.gz |
Merge branch 'refs/heads/ninja-internal' into WebGLFixes
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); | ||
173 | } else { | ||
174 | this.removeElement(elements); | ||
175 | } | ||
176 | |||
177 | this.drawWorkingPlane(); | ||
158 | } | 178 | } |
159 | }, | 179 | }, |
160 | 180 | ||
161 | handleDeleteSelection: { | 181 | handleElementReplaced: { |
162 |