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.js28
1 files changed, 25 insertions, 3 deletions
diff --git a/js/mediators/element-mediator.js b/js/mediators/element-mediator.js
index 2a85aea8..020f875f 100755
--- a/js/mediators/element-mediator.js
+++ b/js/mediators/element-mediator.js
@@ -520,11 +520,33 @@ exports.ElementMediator = Montage.create(Component, {
520 var str = this.getProperty(el, "-webkit-transform"); 520 var str = this.getProperty(el, "-webkit-transform");
521 return str && str.length; 521 return str && str.length;
522 } 522 }
523 } 523 },
524
525 524
525 reArrangeDOM:{
526 value: function(layersDraggedArray, layerDroppedAfter) {
527 var documentRoot,length;
526 528
529 documentRoot = this.application.ninja.currentDocument.documentRoot;
530 length = layersDraggedArray.length;
527 531
528 //-------------------------------------------------------------------------------------------------------- 532 for(var i=0; documentRoot.children[i]; i++) {
533 if(documentRoot.children[i] === layerDroppedAfter.layerData.elementsList[0]) {
534 if(length >0){
535 documentRoot.children[i].parentNode.insertBefore(layersDraggedArray[length-1].layerData.elementsList[0], documentRoot.children[i]);
536 }
529 537
538 /* Will require for Multiple Drag n Drop */
539 //length = length-1;
540 //index = i;
541 //if(length>0) {
542 //while(layersDraggedArray[length]) {
543 //documentRoot.children[index].parentNode.insertBefore(layersDraggedArray[length-1].layerData.elementsList[0],documentRoot.children[k].nextSibling);
544 //length--;
545 //index++;
546 //}
547 //}
548 }
549 }
550 }
551 }
530}); \ No newline at end of file 552}); \ No newline at end of file