Fix in setSvgString() for images with no href (images in pattern#gridpattern don't seem to have them)

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2497 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Jonny Bradley 2013-03-16 14:07:55 +00:00
parent 3be90cdec5
commit 50c248dcb0
1 changed files with 12 additions and 10 deletions

View File

@ -4722,18 +4722,20 @@ this.setSvgString = function(xmlString) {
var image = this;
preventClickDefault(image);
var val = getHref(this);
if (val.indexOf('data:') === 0) {
// Check if an SVG-edit data URI
var m = val.match(/svgedit_url=(.*?);/);
if (m) {
var url = decodeURIComponent(m[1]);
$(new Image()).load(function() {
image.setAttributeNS(NS.XLINK, 'xlink:href', url);
}).attr('src', url);
if (val) {
if (val.indexOf('data:') === 0) {
// Check if an SVG-edit data URI
var m = val.match(/svgedit_url=(.*?);/);
if (m) {
var url = decodeURIComponent(m[1]);
$(new Image()).load(function () {
image.setAttributeNS(xlinkns, 'xlink:href', url);
}).attr('src', url);
}
}
// Add to encodableImages if it loads
canvas.embedImage(val);
}
// Add to encodableImages if it loads
canvas.embedImage(val);
});
// Wrap child SVGs in group elements