aboutsummaryrefslogtreecommitdiff
path: root/js/mediators/element-mediator.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/mediators/element-mediator.js')
-rwxr-xr-xjs/mediators/element-mediator.js46
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