aboutsummaryrefslogtreecommitdiff
path: root/js/mediators
diff options
context:
space:
mode:
authorJohn Mayhew2012-05-07 16:30:19 -0700
committerJohn Mayhew2012-05-07 16:30:19 -0700
commitdb4ba95f50148198759dde503ec1c778184d9dbe (patch)
tree8b79ad58108af2f17d15abc8cdc33d35229ab20d /js/mediators
parent843d8ea8ee58a54bcb71d7b28dbf78fae153b491 (diff)
parent526e423e4a2734c2b139af23911e912452a4443f (diff)
downloadninja-db4ba95f50148198759dde503ec1c778184d9dbe.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into WorkingBranch
Conflicts: js/components/layout/tools-list.reel/tools-list.html js/components/layout/tools-properties.reel/tools-properties.html js/components/tools-properties/brush-properties.reel/brush-properties.html js/components/tools-properties/fill-properties.reel/fill-properties.html js/components/tools-properties/pen-properties.reel/pen-properties.html js/components/tools-properties/pencil-properties.reel/pencil-properties.html js/components/tools-properties/selection-properties.reel/selection-properties.html js/components/tools-properties/shape-properties.reel/shape-properties.html js/components/tools-properties/tag-properties.reel/tag-properties.html js/components/tools-properties/text-properties.reel/text-properties.html
Diffstat (limited to 'js/mediators')
-rwxr-xr-xjs/mediators/drag-drop-mediator.js6
-rwxr-xr-xjs/mediators/element-mediator.js28
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 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