aboutsummaryrefslogtreecommitdiff
path: root/js/mediators/drag-drop-mediator.js
diff options
context:
space:
mode:
authorhwc4872012-04-19 13:01:43 -0700
committerhwc4872012-04-19 13:01:43 -0700
commite6a20fe64574763483dc602bd759278ccf5e5e68 (patch)
tree69defe7200206f0257fe90697136fadef59d521e /js/mediators/drag-drop-mediator.js
parentae7eb87564632ce7c676bd728b8ff2710ff0bb83 (diff)
parent9284c19f076dec3b47ece7dc7bcd22d74e4246c3 (diff)
downloadninja-e6a20fe64574763483dc602bd759278ccf5e5e68.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into Textures
Conflicts: js/lib/drawing/world.js js/lib/geom/geom-obj.js js/lib/rdge/materials/cloud-material.js js/lib/rdge/materials/deform-material.js js/lib/rdge/materials/flat-material.js js/lib/rdge/materials/material.js js/lib/rdge/materials/pulse-material.js js/lib/rdge/materials/relief-tunnel-material.js js/lib/rdge/materials/square-tunnel-material.js js/lib/rdge/materials/star-material.js js/lib/rdge/materials/taper-material.js js/lib/rdge/materials/tunnel-material.js js/lib/rdge/materials/twist-material.js js/lib/rdge/materials/twist-vert-material.js js/lib/rdge/materials/uber-material.js js/lib/rdge/materials/water-material.js js/lib/rdge/materials/z-invert-material.js
Diffstat (limited to 'js/mediators/drag-drop-mediator.js')
-rwxr-xr-xjs/mediators/drag-drop-mediator.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/js/mediators/drag-drop-mediator.js b/js/mediators/drag-drop-mediator.js
index 8663b06e..eedab8fc 100755
--- a/js/mediators/drag-drop-mediator.js
+++ b/js/mediators/drag-drop-mediator.js
@@ -111,6 +111,7 @@ exports.DragDropMediator = Montage.create(Component, {
111 fileName = tempName; 111 fileName = tempName;
112 } 112 }
113 if (save && save.success && save.status === 201) { 113 if (save && save.success && save.status === 201) {
114 var self = this;
114 // 115 //
115 if (e.currentTarget.fileType.indexOf('svg') !== -1) { 116 if (e.currentTarget.fileType.indexOf('svg') !== -1) {
116 element = NJUtils.makeNJElement('embed', 'SVG', 'block');//TODO: Verify this is proper 117 element = NJUtils.makeNJElement('embed', 'SVG', 'block');//TODO: Verify this is proper
@@ -121,19 +122,18 @@ exports.DragDropMediator = Montage.create(Component, {
121 element.src = url+'/'+fileName; 122 element.src = url+'/'+fileName;
122 } 123 }
123 //TODO: Remove temp fix for elements to redraw on drop 124 //TODO: Remove temp fix for elements to redraw on drop
125
124 element.onload = function () { 126 element.onload = function () {
125 NJevent("elementAdding", {el: element, data: rules}); 127 self.application.ninja.elementMediator.addElements(element, rules);
126 } 128 };
127 // 129 //
128 rules = { 130 rules = {
129 'position': 'absolute', 131 'position': 'absolute',
130 'top' : (parseInt(e.currentTarget.filePosition.y) - parseInt(this.application.ninja.stage.userContentTop)) + 'px', 132 'top' : (parseInt(e.currentTarget.filePosition.y) - parseInt(this.application.ninja.stage.userContentTop)) + 'px',
131 'left' : (parseInt(e.currentTarget.filePosition.x) - parseInt(this.application.ninja.stage.userContentLeft)) + 'px', 133 'left' : (parseInt(e.currentTarget.filePosition.x) - parseInt(this.application.ninja.stage.userContentLeft)) + 'px'
132 '-webkit-transform-style' : 'preserve-3d',
133 '-webkit-transform' : 'perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)'
134 }; 134 };
135 // 135 //
136 NJevent("elementAdding", {el: element, data: rules}); 136 self.application.ninja.elementMediator.addElements(element, rules);
137 } else { 137 } else {
138 //TODO: HANDLE ERROR ON SAVING FILE TO BE ADDED AS ELEMENT 138 //TODO: HANDLE ERROR ON SAVING FILE TO BE ADDED AS ELEMENT
139 } 139 }