diff options
author | Kruti Shah | 2012-06-20 09:09:03 -0700 |
---|---|---|
committer | Kruti Shah | 2012-06-20 09:09:03 -0700 |
commit | a62ef1897e9fba4aa98664d2e523092dd2bb9220 (patch) | |
tree | 11c791a173adf5042c92f25bea8fb34e54e78d29 /js/mediators | |
parent | fee2306d642865b493926063029d44535a2c4d85 (diff) | |
parent | 2c60886f68e955195e7e024e0787965e972f0d81 (diff) | |
download | ninja-a62ef1897e9fba4aa98664d2e523092dd2bb9220.tar.gz |
Merge branch 'refs/heads/TimelineUberJD' into Timeline-local-kruti
Conflicts:
js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
Signed-off-by: Kruti Shah <kruti.shah@motorola.com>
Diffstat (limited to 'js/mediators')
-rwxr-xr-x | js/mediators/element-mediator.js | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/js/mediators/element-mediator.js b/js/mediators/element-mediator.js index bd0ae3cb..99d2f822 100755 --- a/js/mediators/element-mediator.js +++ b/js/mediators/element-mediator.js | |||
@@ -483,30 +483,25 @@ exports.ElementMediator = Montage.create(Component, { | |||
483 | }, | 483 | }, |
484 | 484 | ||
485 | reArrangeDOM:{ | 485 | reArrangeDOM:{ |
486 | value: function(layersDraggedArray, layerDroppedAfter) { | 486 | value: function(arrLayersDragged, dropTargetElement) { |
487 | var documentRoot,length; | 487 | var i = 0, |
488 | 488 | arrLayersDraggedLength = arrLayersDragged.length, | |
489 | documentRoot = this.application.ninja.currentDocument.model.documentRoot; | 489 | targetParentNode, |
490 | length = layersDraggedArray.length; | 490 | targetElement; |
491 | 491 | ||
492 | for(var i=0; documentRoot.children[i]; i++) { | 492 | if (arrLayersDraggedLength === 0) { |
493 | if(documentRoot.children[i] === layerDroppedAfter.layerData.stageElement) { | 493 | // Nothing was dragged, so return. |
494 | if(length >0){ | 494 | return; |
495 | documentRoot.children[i].parentNode.insertBefore(layersDraggedArray[length-1].layerData.stageElement, documentRoot.children[i]); | 495 | } |
496 | } | 496 | |
497 | 497 | // Get the target parent node (this will be the parentNode of any of the dragging items) | |
498 | /* Will require for Multiple Drag n Drop */ | 498 | targetParentNode = arrLayersDragged[0].parentNode; |
499 | //length = length-1; | 499 | |
500 | //index = i; | 500 | |
501 | //if(length>0) { | 501 | // Loop through arrLayersDragged and insertBefore the drop target element |
502 | //while(layersDraggedArray[length]) { | 502 | for (i = 0; i < arrLayersDraggedLength; i++) { |
503 | //documentRoot.children[index].parentNode.insertBefore(layersDraggedArray[length-1].layerData.elementsList[0],documentRoot.children[k].nextSibling); | 503 | targetParentNode.insertBefore(arrLayersDragged[i], dropTargetElement); |
504 | //length--; | 504 | } |
505 | //index++; | ||
506 | //} | ||
507 | //} | ||
508 | } | ||
509 | } | ||
510 | } | 505 | } |
511 | } | 506 | } |
512 | }); \ No newline at end of file | 507 | }); \ No newline at end of file |