diff options
-rwxr-xr-x | js/mediators/element-mediator.js | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/js/mediators/element-mediator.js b/js/mediators/element-mediator.js index a5f72462..fb3f2f27 100755 --- a/js/mediators/element-mediator.js +++ b/js/mediators/element-mediator.js | |||
@@ -168,7 +168,7 @@ exports.ElementMediator = Montage.create(Component, { | |||
168 | @param stageRedraw: *OPTIONAL*: True. If set to false the stage will not redraw the selection/outline | 168 | @param stageRedraw: *OPTIONAL*: True. If set to false the stage will not redraw the selection/outline |
169 | */ | 169 | */ |
170 | setProperty: { | 170 | setProperty: { |
171 | value: function(els, p, value, eventType, source, currentValue, stageRedraw) { | 171 | value: function(els, p, value, eventType, source, currentValue) { |
172 | if(eventType === "Changing") { | 172 | if(eventType === "Changing") { |
173 | this._setProperty(els, p, value, eventType, source); | 173 | this._setProperty(els, p, value, eventType, source); |
174 | } else { | 174 | } else { |
@@ -228,13 +228,10 @@ exports.ElementMediator = Montage.create(Component, { | |||
228 | 228 | ||
229 | /** | 229 | /** |
230 | Sets a property object for an element or array of elements. The same properties object gets applied to all the elements | 230 | Sets a property object for an element or array of elements. The same properties object gets applied to all the elements |
231 | @param els: Array of elements. Can contain 1 or more elements | 231 | @param elements: Array of elements objects: element, properties and previousProperties |
232 | @param properties: Properties object containing both the value and property | ||
233 | @param currentProperties: current properties object for undo/redo. Must be an valid object or null | ||
234 | @param eventType: Change/Changing. Will be passed to the dispatched event | 232 | @param eventType: Change/Changing. Will be passed to the dispatched event |
235 | @param source: String for the source object making the call | 233 | @param source: String for the source object making the call |
236 | */ | 234 | */ |
237 | /*value: function(elements, properties, currentProperties, eventType, source) {*/ | ||
238 | setProperties: { | 235 | setProperties: { |
239 | value: function(elements, eventType, source) { | 236 | value: function(elements, eventType, source) { |
240 | 237 | ||
@@ -252,19 +249,8 @@ exports.ElementMediator = Montage.create(Component, { | |||
252 | document.application.undoManager.add(undoLabel, this.setProperties, this, elements, eventType, source); | 249 | document.application.undoManager.add(undoLabel, this.setProperties, this, elements, eventType, source); |
253 | } | 250 | } |
254 | 251 | ||
255 | /* | ||
256 | // Assume elements is an array of elements always | ||
257 | elements.forEach(function(element) { | ||
258 | element.elementModel.controller["setProperties"](element, properties); | ||
259 | }); | ||
260 | |||
261 | // Add to undo only when a change is requested | ||
262 | if(eventType !== "Changing") { | ||
263 | var undoLabel = "Properties change"; | ||
264 | document.application.undoManager.add(undoLabel, this.setProperties, this, elements, currentProperties, properties, eventType, source); | ||
265 | } | ||
266 | */ | ||
267 | // Map the elements for the event data | 252 | // Map the elements for the event data |
253 | // TODO: Clean this up | ||
268 | var els = elements.map(function(element) { | 254 | var els = elements.map(function(element) { |
269 | return element.element; | 255 | return element.element; |
270 | }); | 256 | }); |
@@ -317,7 +303,7 @@ exports.ElementMediator = Montage.create(Component, { | |||
317 | @param stageRedraw: *OPTIONAL*: True. If set to false the stage will not redraw the selection/outline | 303 | @param stageRedraw: *OPTIONAL*: True. If set to false the stage will not redraw the selection/outline |
318 | */ | 304 | */ |
319 | setColor: { | 305 | setColor: { |
320 | value: function(els, value, isFill, eventType, source, currentValue, stageRedraw) { | 306 | value: function(els, value, isFill, eventType, source, currentValue) { |
321 | 307 | ||
322 | if(eventType === "Changing") { | 308 | if(eventType === "Changing") { |
323 | this._setColor(els, value, isFill, eventType, source); | 309 | this._setColor(els, value, isFill, eventType, source); |
@@ -394,7 +380,7 @@ exports.ElementMediator = Montage.create(Component, { | |||
394 | @param stageRedraw: *OPTIONAL*: True. If set to false the stage will not redraw the selection/outline | 380 | @param stageRedraw: *OPTIONAL*: True. If set to false the stage will not redraw the selection/outline |
395 | */ | 381 | */ |
396 | setStroke: { | 382 | setStroke: { |
397 | value: function(els, value, eventType, source, currentValue, stageRedraw) { | 383 | value: function(els, value, eventType, source, currentValue) { |
398 | 384 | ||
399 | if(eventType === "Changing") { | 385 | if(eventType === "Changing") { |
400 | this._setStroke(els, value, isFill, eventType, source); | 386 | this._setStroke(els, value, isFill, eventType, source); |