diff options
author | Jose Antonio Marquez | 2012-03-15 21:06:40 -0700 |
---|---|---|
committer | Jose Antonio Marquez | 2012-03-15 21:06:40 -0700 |
commit | a295375178659345e03517f7eb20c22364f4ca4a (patch) | |
tree | 05cc1e0e53fb5589e4c4498a69056094e469a216 | |
parent | eda07f5122cc552737fa6f647ef7f6721c4001b8 (diff) | |
download | ninja-a295375178659345e03517f7eb20c22364f4ca4a.tar.gz |
Temp fix for element dimensions (SVG)
Added a temp fix to allow for a redraw of an SVG on load.
-rwxr-xr-x | js/mediators/drag-drop-mediator.js | 10 |
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 | } |