Fix SVG issue for older browsers (fixes #1191)
This commit is contained in:
parent
fac134dd95
commit
c232eb2478
5
src/js/controls.js
vendored
5
src/js/controls.js
vendored
@ -111,10 +111,11 @@ const controls = {
|
|||||||
// https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/xlink:href
|
// https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/xlink:href
|
||||||
if ('href' in use) {
|
if ('href' in use) {
|
||||||
use.setAttributeNS('http://www.w3.org/1999/xlink', 'href', path);
|
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>
|
// Add <use> to <svg>
|
||||||
icon.appendChild(use);
|
icon.appendChild(use);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user