diff options
author | Saivan <savian@me.com> | 2018-03-02 12:48:43 +1100 |
---|---|---|
committer | Saivan <savian@me.com> | 2018-03-02 12:48:43 +1100 |
commit | a208ed5c5de4b654efc54c2bcbe8dc7d4875392d (patch) | |
tree | d435e0e1e1b926f2fb3484717728b21f96c7a78e /src/parent.js | |
parent | 1582edb4236628fbc7875242f159c16283b769c2 (diff) | |
parent | c4373581ab49dff509a857eb4e896f00fc81add6 (diff) | |
download | svg.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.js | 6 |
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 |