Merge pull request #769 from buggyj/xlink2

added support for xlink: attribute prefix
print-window-tiddler
Jeremy Ruston 2014-08-30 23:04:14 +01:00
commit 032520fbe1
1 zmienionych plików z 7 dodań i 1 usunięć

Wyświetl plik

@ -263,9 +263,15 @@ Widget.prototype.assignAttributes = function(domNode,options) {
v = undefined;
}
if(v !== undefined) {
var b = a.split(":");
// Setting certain attributes can cause a DOM error (eg xmlns on the svg element)
try {
domNode.setAttributeNS(null,a,v);
if (b.length == 2 && b[0] == "xlink"){
domNode.setAttributeNS("http://www.w3.org/1999/xlink",b[1],v);
}
else {
domNode.setAttributeNS(null,a,v);
}
} catch(e) {
}
}