diff options
author | Jose Antonio Marquez | 2012-05-03 15:32:03 -0700 |
---|---|---|
committer | Jose Antonio Marquez | 2012-05-03 15:32:03 -0700 |
commit | ad70905eaa725c7c5638436da1306ccea30e343c (patch) | |
tree | 5233e824a78589b8ff4ed072929dfe0ca3d73d6a /js/mediators | |
parent | 6356edefaea3fe78969c53fec2d371cb8f42d820 (diff) | |
parent | 602240c38e0f2c3937d3c7246247e0b59bccab2b (diff) | |
download | ninja-ad70905eaa725c7c5638436da1306ccea30e343c.tar.gz |
Merge branch 'refs/heads/Ninja-Internal' into Document
Diffstat (limited to 'js/mediators')
-rwxr-xr-x | js/mediators/element-mediator.js | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/js/mediators/element-mediator.js b/js/mediators/element-mediator.js index 919aaec1..06514076 100755 --- a/js/mediators/element-mediator.js +++ b/js/mediators/element-mediator.js | |||
@@ -514,11 +514,33 @@ exports.ElementMediator = Montage.create(Component, { | |||
514 | var str = this.getProperty(el, "-webkit-transform"); | 514 | var str = this.getProperty(el, "-webkit-transform"); |
515 | return str && str.length; | 515 | return str && str.length; |
516 | } | 516 | } |
517 | } | 517 | }, |
518 | |||
519 | 518 | ||
519 | reArrangeDOM:{ | ||
520 | value: function(layersDraggedArray, layerDroppedAfter) { | ||
521 | var documentRoot,length; | ||
520 | 522 | ||
523 | documentRoot = this.application.ninja.currentDocument.documentRoot; | ||
524 | length = layersDraggedArray.length; | ||
521 | 525 | ||
522 | //-------------------------------------------------------------------------------------------------------- | 526 | for(var i=0; documentRoot.children[i]; i++) { |
527 | if(documentRoot.children[i] === layerDroppedAfter.layerData.elementsList[0]) { | ||
528 | if(length >0){ | ||
529 | documentRoot.children[i].parentNode.insertBefore(layersDraggedArray[length-1].layerData.elementsList[0], documentRoot.children[i]); | ||
530 | } | ||
523 | 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 | } | ||
543 | } | ||
544 | } | ||
545 | } | ||
524 | }); \ No newline at end of file | 546 | }); \ No newline at end of file |