Added timeout to PNG export for server_opensave extension

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1669 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Alexis Deveria 2010-08-18 16:45:02 +00:00
parent 1ef6188da3
commit 3130f85ac6
1 changed files with 29 additions and 25 deletions

View File

@ -43,6 +43,9 @@ svgEditor.addExtension("server_opensave", {
c.width = svgCanvas.contentW;
c.height = svgCanvas.contentH;
canvg(c, data.svg);
// Timeout to allow canvg to run a bit
setTimeout(function() {
var datauri = c.toDataURL('image/png');
var uiStrings = svgEditor.uiStrings;
@ -69,6 +72,7 @@ svgEditor.addExtension("server_opensave", {
.append('<input type="hidden" name="filename" value="' + filename + '">')
.appendTo('body')
.submit().remove();
}, 1000);
}