diff options
author | Jose Antonio Marquez | 2012-03-15 21:06:57 -0700 |
---|---|---|
committer | Jose Antonio Marquez | 2012-03-15 21:06:57 -0700 |
commit | 810b6a194c8cad0909de72fb97310f67e3ccc822 (patch) | |
tree | 026d4727563e93e93dd27224902f830ad4049bcd | |
parent | fe41b6702d09b2c103a35fbabf88948a4a00cfe8 (diff) | |
parent | a295375178659345e03517f7eb20c22364f4ca4a (diff) | |
download | ninja-810b6a194c8cad0909de72fb97310f67e3ccc822.tar.gz |
Merge branch 'refs/heads/FileIO' into FileIO-Build-Candidate
-rwxr-xr-x | js/mediators/drag-drop-mediator.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/js/mediators/drag-drop-mediator.js b/js/mediators/drag-drop-mediator.js index cc384704..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; |
@@ -112,11 +116,11 @@ exports.DragDropMediator = Montage.create(Component, { | |||
112 | // | 116 | // |
113 | rules = { | 117 | rules = { |
114 | 'position': 'absolute', | 118 | 'position': 'absolute', |
115 | 'top' : e.currentTarget.filePosition.y + 'px', | 119 | 'top' : (parseInt(e.currentTarget.filePosition.y) - parseInt(this.application.ninja.stage.userContentTop)) + 'px', |
116 | 'left' : e.currentTarget.filePosition.x + '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 | } |