Don't use a data-url
Pass the SVG to the editor, using editor.svgCanvas.setSvgString(selected); instead. (Suggested by Jeff Schiller) Fix a bug with line and freehand tools caused by activating foreignObject tool. (Again, fix due to Jeff) Sync with SVG-Edit.
This commit is contained in:
parent
e744a697c2
commit
52d85c6d01
5 changed files with 110 additions and 77 deletions
|
@ -82,11 +82,11 @@ function setupSVGedit(path){
|
|||
f.insert({top: SVGeditButton});
|
||||
SVGeditButton.disabled = true;
|
||||
Event.observe(SVGeditButton, 'click', function(){
|
||||
var editor = window.open(path, 'Edit SVG graphic', 'status=1,resizable=1,scrollbars=1');
|
||||
if (selected) {
|
||||
var editor = window.open(path +'?source=data:image/svg+xml;base64,' + window.btoa(selected),
|
||||
'Editing Existing SVG Graphic', 'status=1,resizable=1,scrollbars=1');
|
||||
} else {
|
||||
var editor = window.open(path, 'Creating New SVG graphic', 'status=1,resizable=1,scrollbars=1');
|
||||
editor.addEventListener("load", function() {
|
||||
editor.svgCanvas.setSvgString(selected);
|
||||
}, true);
|
||||
}
|
||||
SVGeditButton.disabled = true;
|
||||
SVGeditButton.value = 'Create SVG graphic';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue