Fix SVG issue for older browsers (fixes #1191)

This commit is contained in:
Sam Potts 2018-10-24 22:30:41 +11:00
parent fac134dd95
commit c232eb2478

5
src/js/controls.js vendored
View File

@ -111,10 +111,11 @@ const controls = {
// https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/xlink:href
if ('href' in use) {
use.setAttributeNS('http://www.w3.org/1999/xlink', 'href', path);
} else {
use.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', path);
}
// Always set the older attribute even though it's "deprecated" (it'll be around for ages)
use.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', path);
// Add <use> to <svg>
icon.appendChild(use);