diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2017-07-28 14:20:48 +0200 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2017-07-28 14:20:48 +0200 |
commit | 6faf2c538a90e99e5fadd8662955466ba4ebe6f1 (patch) | |
tree | 86527be80ae580bad129a66366e5700ca75b83d5 /src/svg.js | |
parent | ecea84ea3ae7f9986144c4fbd70994cfb9925654 (diff) | |
download | svg.js-6faf2c538a90e99e5fadd8662955466ba4ebe6f1.tar.gz svg.js-6faf2c538a90e99e5fadd8662955466ba4ebe6f1.zip |
The dom is checked for an svgjs:data attribute which is imported when creating an element
Diffstat (limited to 'src/svg.js')
-rw-r--r-- | src/svg.js | 7 |
1 files changed, 1 insertions, 6 deletions
@@ -89,17 +89,12 @@ SVG.adopt = function(node) { // adopt with element-specific settings if (node.nodeName == 'svg') element = node.parentNode instanceof window.SVGElement ? new SVG.Nested(node) : new SVG.Doc(node) - else if (node.nodeName == 'linearGradient') - element = new SVG.Gradient(node) - else if (node.nodeName == 'radialGradient') + else if (node.nodeName == 'linearGradient' || node.nodeName == 'radialGradient') element = new SVG.Gradient(node) else if (SVG[capitalize(node.nodeName)]) element = new SVG[capitalize(node.nodeName)](node) else element = new SVG.Parent(node) - // pull svgjs data from the dom (getAttributeNS doesn't work in html5) - element.setData(JSON.parse(node.getAttribute('svgjs:data')) || {}) - return element } |