apply: SVG className workaround

This commit is contained in:
tophf 2017-09-17 10:56:03 +03:00
parent 9210d55438
commit 054528edde

View File

@ -249,10 +249,11 @@ function applySections(styleId, code) {
} }
Object.assign(el, { Object.assign(el, {
id: ID_PREFIX + styleId, id: ID_PREFIX + styleId,
className: 'stylus',
type: 'text/css', type: 'text/css',
textContent: code, textContent: code,
}); });
// SVG className is not a string, but an instance of SVGAnimatedString
el.classList.add('stylus');
addStyleElement(el); addStyleElement(el);
styleElements.set(el.id, el); styleElements.set(el.id, el);
disabledElements.delete(Number(styleId)); disabledElements.delete(Number(styleId));