diff options
author | Valerio Virgillito | 2012-05-03 13:35:37 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-05-03 13:35:37 -0700 |
commit | 602240c38e0f2c3937d3c7246247e0b59bccab2b (patch) | |
tree | 6e4ed3fc6b3d6ab7aa0500b6b06f05744b8ddbb6 /js/mediators | |
parent | a68c52ec84248cc1d8393d277edab6a4d3353c7e (diff) | |
download | ninja-602240c38e0f2c3937d3c7246247e0b59bccab2b.tar.gz |
minor formatting
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/mediators')
-rwxr-xr-x | js/mediators/element-mediator.js | 46 |
1 files changed, 20 insertions, 26 deletions
diff --git a/js/mediators/element-mediator.js b/js/mediators/element-mediator.js index 49a8e369..06514076 100755 --- a/js/mediators/element-mediator.js +++ b/js/mediators/element-mediator.js | |||
@@ -517,36 +517,30 @@ exports.ElementMediator = Montage.create(Component, { | |||
517 | }, | 517 | }, |
518 | 518 | ||
519 | reArrangeDOM:{ | 519 | reArrangeDOM:{ |
520 | value:function(layersDraggedArray , layerDroppedAfter){ | 520 | value: function(layersDraggedArray, layerDroppedAfter) { |
521 | var documentRoot,length; | ||
521 | 522 | ||
522 | var documentRoot,length; | 523 | documentRoot = this.application.ninja.currentDocument.documentRoot; |
524 | length = layersDraggedArray.length; | ||
523 | 525 | ||
524 | documentRoot = this.application.ninja.currentDocument.documentRoot; | 526 | for(var i=0; documentRoot.children[i]; i++) { |
525 | length = layersDraggedArray.length; | 527 | if(documentRoot.children[i] === layerDroppedAfter.layerData.elementsList[0]) { |
526 | 528 | if(length >0){ | |
527 | for(i=0;documentRoot.children[i];i++){ | 529 | documentRoot.children[i].parentNode.insertBefore(layersDraggedArray[length-1].layerData.elementsList[0], documentRoot.children[i]); |
528 | if(documentRoot.children[i]===layerDroppedAfter.layerData.elementsList[0]){ | ||
529 | if(length >0){ | ||
530 | documentRoot.children[i].parentNode.insertBefore(layersDraggedArray[length-1].layerData.elementsList[0],documentRoot.children[i]); | ||
531 | } | ||
532 | /* Will require for Multiple Drag n Drop */ | ||
533 | // length = length-1; | ||
534 | // index=i; | ||
535 | // if(length>0){ | ||
536 | // while(layersDraggedArray[length]){ | ||
537 | // documentRoot.children[index].parentNode.insertBefore(layersDraggedArray[length-1].layerData.elementsList[0],documentRoot.children[k].nextSibling); | ||
538 | // length--; | ||
539 | // index++; | ||
540 | // } | ||
541 | // } | ||
542 | } | 530 | } |
531 | |||
532 | /* Will require for Multiple Drag n Drop */ | ||
533 | //length = length-1; | ||
534 | //index = i; | ||
535 | //if(length>0) { | ||
536 | //while(layersDraggedArray[length]) { | ||
537 | //documentRoot.children[index].parentNode.insertBefore(layersDraggedArray[length-1].layerData.elementsList[0],documentRoot.children[k].nextSibling); | ||
538 | //length--; | ||
539 | //index++; | ||
540 | //} | ||
541 | //} | ||
543 | } | 542 | } |
544 | } | 543 | } |
545 | } | 544 | } |
546 | 545 | } | |
547 | |||
548 | |||
549 | |||
550 | //-------------------------------------------------------------------------------------------------------- | ||
551 | |||
552 | }); \ No newline at end of file | 546 | }); \ No newline at end of file |