diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2017-03-29 16:10:36 +0200 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2017-03-29 16:10:36 +0200 |
commit | bb38273b6a2efd3795480cc36fa0ad0d67b73997 (patch) | |
tree | 146cc8f4fddb6d1203126546e0610077b42f4588 /src/doc.js | |
parent | ebf7436261c8fc3197a48dc6b21dff9edd9271e3 (diff) | |
download | svg.js-bb38273b6a2efd3795480cc36fa0ad0d67b73997.tar.gz svg.js-bb38273b6a2efd3795480cc36fa0ad0d67b73997.zip |
clear does not remove parser anymore
make test work in svg documents
Diffstat (limited to 'src/doc.js')
-rw-r--r-- | src/doc.js | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -76,6 +76,20 @@ SVG.Doc = SVG.invent({ return this; } + , clear: function() { + // remove children + while(this.node.hasChildNodes()) + this.node.removeChild(this.node.lastChild) + + // remove defs reference + delete this._defs + + // add back parser + if(!SVG.parser.draw.parentNode) + this.node.appendChild(SVG.parser.draw) + + return this + } } }) |