aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-03-15 21:06:40 -0700
committerJose Antonio Marquez2012-03-15 21:06:40 -0700
commita295375178659345e03517f7eb20c22364f4ca4a (patch)
tree05cc1e0e53fb5589e4c4498a69056094e469a216 /js
parenteda07f5122cc552737fa6f647ef7f6721c4001b8 (diff)
downloadninja-a295375178659345e03517f7eb20c22364f4ca4a.tar.gz
Temp fix for element dimensions (SVG)
Added a temp fix to allow for a redraw of an SVG on load.
Diffstat (limited to 'js')
-rwxr-xr-xjs/mediators/drag-drop-mediator.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/js/mediators/drag-drop-mediator.js b/js/mediators/drag-drop-mediator.js
index c8e781a6..9d5dd256 100755
--- a/js/mediators/drag-drop-mediator.js
+++ b/js/mediators/drag-drop-mediator.js
@@ -105,6 +105,10 @@ exports.DragDropMediator = Montage.create(Component, {
105 element = NJUtils.makeNJElement('embed', 'SVG', 'block');//TODO: Verify this is proper 105 element = NJUtils.makeNJElement('embed', 'SVG', 'block');//TODO: Verify this is proper
106 element.src = url+'/'+fileName; 106 element.src = url+'/'+fileName;
107 element.type = 'image/svg+xml'; 107 element.type = 'image/svg+xml';
108 //TODO: Remove temp fix for SVG redraw on drop
109 element.onload = function () {
110 NJevent("elementAdding", {el: element, data: rules});
111 }
108 } else { 112 } else {
109 element = NJUtils.makeNJElement('image', 'image', 'image'); 113 element = NJUtils.makeNJElement('image', 'image', 'image');
110 element.src = url+'/'+fileName; 114 element.src = url+'/'+fileName;
@@ -114,9 +118,9 @@ exports.DragDropMediator = Montage.create(Component, {
114 'position': 'absolute', 118 'position': 'absolute',
115 'top' : (parseInt(e.currentTarget.filePosition.y) - parseInt(this.application.ninja.stage.userContentTop)) + 'px', 119 'top' : (parseInt(e.currentTarget.filePosition.y) - parseInt(this.application.ninja.stage.userContentTop)) + 'px',
116 'left' : (parseInt(e.currentTarget.filePosition.x) - parseInt(this.application.ninja.stage.userContentLeft)) + 'px' 120 'left' : (parseInt(e.currentTarget.filePosition.x) - parseInt(this.application.ninja.stage.userContentLeft)) + 'px'
117 }; 121 };
118 // 122 //
119 NJevent("elementAdding", {el: element, data: rules}); 123 NJevent("elementAdding", {el: element, data: rules});
120 } else { 124 } else {
121 //TODO: HANDLE ERROR ON SAVING FILE TO BE ADDED AS ELEMENT 125 //TODO: HANDLE ERROR ON SAVING FILE TO BE ADDED AS ELEMENT
122 } 126 }