summaryrefslogtreecommitdiffstats
path: root/src/parent.js
diff options
context:
space:
mode:
authorSaivan <savian@me.com>2018-03-02 12:48:43 +1100
committerSaivan <savian@me.com>2018-03-02 12:48:43 +1100
commita208ed5c5de4b654efc54c2bcbe8dc7d4875392d (patch)
treed435e0e1e1b926f2fb3484717728b21f96c7a78e /src/parent.js
parent1582edb4236628fbc7875242f159c16283b769c2 (diff)
parentc4373581ab49dff509a857eb4e896f00fc81add6 (diff)
downloadsvg.js-a208ed5c5de4b654efc54c2bcbe8dc7d4875392d.tar.gz
svg.js-a208ed5c5de4b654efc54c2bcbe8dc7d4875392d.zip
Fixed some tests involving transforms and elements
Diffstat (limited to 'src/parent.js')
-rw-r--r--src/parent.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/parent.js b/src/parent.js
index 0ff1765..d48e086 100644
--- a/src/parent.js
+++ b/src/parent.js
@@ -21,10 +21,8 @@ SVG.Parent = SVG.invent({
add: function (element, i) {
element = createElement(element)
- if (i == null) {
- this.node.appendChild(element.node)
- } else if (element.node !== this.node.children[i]) {
- this.node.insertBefore(element.node, this.node.children[i])
+ if (element.node !== this.node.children[i]) {
+ this.node.insertBefore(element.node, this.node.children[i] || null)
}
return this