summaryrefslogtreecommitdiffstats
path: root/src/svg.js
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2017-07-28 14:20:48 +0200
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2017-07-28 14:20:48 +0200
commit6faf2c538a90e99e5fadd8662955466ba4ebe6f1 (patch)
tree86527be80ae580bad129a66366e5700ca75b83d5 /src/svg.js
parentecea84ea3ae7f9986144c4fbd70994cfb9925654 (diff)
downloadsvg.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.js7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/svg.js b/src/svg.js
index 3441348..ea27c5c 100644
--- a/src/svg.js
+++ b/src/svg.js
@@ -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
}