aboutsummaryrefslogtreecommitdiffstats
path: root/src/element.js
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2015-06-15 16:15:07 +0200
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2015-06-15 16:15:07 +0200
commit5d80e4393109e181b0ba997e338530c0e2af1dd7 (patch)
tree41f4bee9860bafe86578a47f0e0f5540e3662122 /src/element.js
parent0cc5347da6bc18e3a1b2bb87ccbe53adc3f7c5c7 (diff)
downloadsvg.js-5d80e4393109e181b0ba997e338530c0e2af1dd7.tar.gz
svg.js-5d80e4393109e181b0ba997e338530c0e2af1dd7.zip
Fixed bug with doc() which should always return the root SVG
Replaced split-function with an easier and faster one
Diffstat (limited to 'src/element.js')
-rwxr-xr-xsrc/element.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/element.js b/src/element.js
index d64872a..1583196 100755
--- a/src/element.js
+++ b/src/element.js
@@ -179,7 +179,7 @@ SVG.Element = SVG.invent({
}
// Get parent document
, doc: function(type) {
- return this.parent(type || SVG.Doc)
+ return this instanceof SVG.Doc ? this : this.parent(SVG.Doc)
}
// Returns the svg node to call native svg methods on it
, native: function() {