summaryrefslogtreecommitdiffstats
path: root/src/HtmlNode.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/HtmlNode.js')
-rw-r--r--src/HtmlNode.js10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/HtmlNode.js b/src/HtmlNode.js
index 30cb4cf..e7dae10 100644
--- a/src/HtmlNode.js
+++ b/src/HtmlNode.js
@@ -8,15 +8,9 @@ SVG.HtmlNode = SVG.invent({
extend: {
add: function (element, i) {
element = createElement(element)
- if (element instanceof SVG.Nested) {
- element = new SVG.Doc(element.node)
- element.setData(JSON.parse(element.node.getAttribute('svgjs:data')) || {})
- }
- 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