aboutsummaryrefslogtreecommitdiffstats
path: root/src/svg.js
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2018-02-11 15:29:23 +0100
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2018-03-01 02:06:05 +0100
commit64a5c17b95393c0914670b1b9e2c8b4d63707968 (patch)
treed474bc95c101a44c91ee0ae8f7ccd73bb3acb48d /src/svg.js
parent3d1b02f878756dece8a20c0110497ccc70b4f363 (diff)
downloadsvg.js-64a5c17b95393c0914670b1b9e2c8b4d63707968.tar.gz
svg.js-64a5c17b95393c0914670b1b9e2c8b4d63707968.zip
merge SVG.Doc and SVG.Nested. Add isRoot() method, update doc methods to decide between doc and nested
Diffstat (limited to 'src/svg.js')
-rw-r--r--src/svg.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/svg.js b/src/svg.js
index 55cb88d..4cb6f26 100644
--- a/src/svg.js
+++ b/src/svg.js
@@ -87,9 +87,9 @@ SVG.adopt = function (node) {
var element
// 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' || node.nodeName === 'radialGradient') {
+ if (node.nodeName == 'svg')
+ element = new SVG.Doc(node)
+ 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)