diff options
author | Valerio Virgillito | 2012-05-03 13:31:02 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-05-03 13:31:02 -0700 |
commit | a68c52ec84248cc1d8393d277edab6a4d3353c7e (patch) | |
tree | 57e02dbd48df47ccc73311212ae562bdf5613f80 /js/mediators/element-mediator.js | |
parent | 691beb1c39fc0baa683f1fc56cbc519fe58f306d (diff) | |
parent | 92e7297c153b432ede5b95d86cd934c990ebe768 (diff) | |
download | ninja-a68c52ec84248cc1d8393d277edab6a4d3353c7e.tar.gz |
Merge branch 'Master-Dom-Manipulation' of https://github.com/ntfx47/ninja-internal
Diffstat (limited to 'js/mediators/element-mediator.js')
-rwxr-xr-x | js/mediators/element-mediator.js | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/js/mediators/element-mediator.js b/js/mediators/element-mediator.js index 919aaec1..49a8e369 100755 --- a/js/mediators/element-mediator.js +++ b/js/mediators/element-mediator.js | |||
@@ -514,7 +514,35 @@ 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 | reArrangeDOM:{ | ||
520 | value:function(layersDraggedArray , layerDroppedAfter){ | ||
521 | |||
522 | var documentRoot,length; | ||
523 | |||
524 | documentRoot = this.application.ninja.currentDocument.documentRoot; | ||
525 | length = layersDraggedArray.length; | ||
526 | |||
527 | for(i=0;documentRoot.children[i];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 | } | ||
543 | } | ||
544 | } | ||
545 | } | ||
518 | 546 | ||
519 | 547 | ||
520 | 548 | ||