diff options
author | hwc487 | 2012-05-11 13:52:55 -0700 |
---|---|---|
committer | hwc487 | 2012-05-11 13:52:55 -0700 |
commit | 137bfc9d4c41cc918d969565bec28a834fe10472 (patch) | |
tree | e9fa109fc65218f45e386df48b713ff5858f3d62 /js/mediators | |
parent | d21aaca3d7093b6af968b7f9f764ab54e004f02b (diff) | |
parent | 27f4cacb39de1c2e3910748dadc9fc16d0655480 (diff) | |
download | ninja-137bfc9d4c41cc918d969565bec28a834fe10472.tar.gz |
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into Textures
Conflicts:
js/lib/geom/geom-obj.js
js/lib/geom/rectangle.js
js/tools/TagTool.js
Diffstat (limited to 'js/mediators')
-rwxr-xr-x | js/mediators/drag-drop-mediator.js | 6 | ||||
-rwxr-xr-x | js/mediators/element-mediator.js | 28 |
2 files changed, 29 insertions, 5 deletions
diff --git a/js/mediators/drag-drop-mediator.js b/js/mediators/drag-drop-mediator.js index b0aba5b6..59086ef6 100755 --- a/js/mediators/drag-drop-mediator.js +++ b/js/mediators/drag-drop-mediator.js | |||
@@ -114,11 +114,13 @@ exports.DragDropMediator = Montage.create(Component, { | |||
114 | var self = this; | 114 | var self = this; |
115 | // | 115 | // |
116 | if (e.currentTarget.fileType.indexOf('svg') !== -1) { | 116 | if (e.currentTarget.fileType.indexOf('svg') !== -1) { |
117 | element = NJUtils.makeNJElement('embed', 'SVG', 'block');//TODO: Verify this is proper | 117 | element = NJUtils.make('embed', null, this.application.ninja.currentDocument);//TODO: Verify this is proper |
118 | NJUtils.createModelWithSelection(element, "SVG"); | ||
118 | element.type = 'image/svg+xml'; | 119 | element.type = 'image/svg+xml'; |
119 | element.src = url+'/'+fileName; | 120 | element.src = url+'/'+fileName; |
120 | } else { | 121 | } else { |
121 | element = NJUtils.makeNJElement('image', 'image', 'image'); | 122 | element = NJUtils.make('image', null, this.application.ninja.currentDocument); |
123 | NJUtils.createModel(element); | ||
122 | element.src = url+'/'+fileName; | 124 | element.src = url+'/'+fileName; |
123 | } | 125 | } |
124 | //Adding element once it is loaded | 126 | //Adding element once it is loaded |
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 |