diff options
Diffstat (limited to 'js/mediators/element-mediator.js')
-rwxr-xr-x | js/mediators/element-mediator.js | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/js/mediators/element-mediator.js b/js/mediators/element-mediator.js index 611cf214..33377d72 100755 --- a/js/mediators/element-mediator.js +++ b/js/mediators/element-mediator.js | |||
@@ -295,10 +295,10 @@ exports.ElementMediator = Montage.create(Component, { | |||
295 | @param stageRedraw: *OPTIONAL*: True. If set to false the stage will not redraw the selection/outline | 295 | @param stageRedraw: *OPTIONAL*: True. If set to false the stage will not redraw the selection/outline |
296 | */ | 296 | */ |
297 | setColor: { | 297 | setColor: { |
298 | value: function(els, value, isFill, eventType, source, currentValue) { | 298 | value: function(els, value, isFill, eventType, source, currentValue,borderSide) { |
299 | 299 | ||
300 | if(eventType === "Changing") { | 300 | if(eventType === "Changing") { |
301 | this._setColor(els, value, isFill, eventType, source); | 301 | this._setColor(els, value, isFill, eventType, source,borderSide); |
302 | } else { | 302 | } else { |
303 | // Calculate currentValue if not found for each element | 303 | // Calculate currentValue if not found for each element |
304 | if(!currentValue) { | 304 | if(!currentValue) { |
@@ -317,11 +317,12 @@ exports.ElementMediator = Montage.create(Component, { | |||
317 | _source: { value: "undo-redo"}, | 317 | _source: { value: "undo-redo"}, |
318 | description: { value: "Set Color"}, | 318 | description: { value: "Set Color"}, |
319 | receiver: { value: this}, | 319 | receiver: { value: this}, |
320 | _borderSide: { value: borderSide}, | ||
320 | 321 | ||
321 | execute: { | 322 | execute: { |
322 | value: function(senderObject) { | 323 | value: function(senderObject) { |
323 | if(senderObject) this._source = senderObject; | 324 | if(senderObject) this._source = senderObject; |
324 | this.receiver._setColor(this._els, this._value, this._isFill, this._eventType, this._source); | 325 | this.receiver._setColor(this._els, this._value, this._isFill, this._eventType, this._source,this._borderSide); |
325 | this._source = "undo-redo"; | 326 | this._source = "undo-redo"; |
326 | return ""; | 327 | return ""; |
327 | } | 328 | } |
@@ -343,12 +344,12 @@ exports.ElementMediator = Montage.create(Component, { | |||
343 | }, | 344 | }, |
344 | 345 | ||
345 | _setColor: { | 346 | _setColor: { |
346 | value: function(els, value, isFill, eventType, source) { | 347 | value: function(els, value, isFill, eventType, source,borderSide) { |
347 | for(var i=0, item; item = els[i]; i++) { | 348 | for(var i=0, item; item = els[i]; i++) { |
348 | item.elementModel.controller["setColor"](item, value, isFill); | 349 | item.elementModel.controller["setColor"](item, value, isFill,borderSide); |
349 | } | 350 | } |
350 | 351 | ||
351 | NJevent("element" + eventType, {type : "setColor", source: source, data: {"els": els, "prop": "color", "value": value, "isFill": isFill}, redraw: null}); | 352 | NJevent("element" + eventType, {type : "setColor", source: source, data: {"els": els, "prop": "color", "value": value, "isFill": isFill, "borderSide":borderSide}, redraw: null}); |
352 | } | 353 | } |
353 | }, | 354 | }, |
354 | 355 | ||
@@ -490,9 +491,9 @@ exports.ElementMediator = Montage.create(Component, { | |||
490 | length = layersDraggedArray.length; | 491 | length = layersDraggedArray.length; |
491 | 492 | ||
492 | for(var i=0; documentRoot.children[i]; i++) { | 493 | for(var i=0; documentRoot.children[i]; i++) { |
493 | if(documentRoot.children[i] === layerDroppedAfter.layerData.elementsList[0]) { | 494 | if(documentRoot.children[i] === layerDroppedAfter.layerData.stageElement) { |
494 | if(length >0){ | 495 | if(length >0){ |
495 | documentRoot.children[i].parentNode.insertBefore(layersDraggedArray[length-1].layerData.elementsList[0], documentRoot.children[i]); | 496 | documentRoot.children[i].parentNode.insertBefore(layersDraggedArray[length-1].layerData.stageElement, documentRoot.children[i]); |
496 | } | 497 | } |
497 | 498 | ||
498 | /* Will require for Multiple Drag n Drop */ | 499 | /* Will require for Multiple Drag n Drop */ |