diff options
author | wout <wout@impinc.co.uk> | 2013-05-08 11:10:20 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2013-05-08 11:10:20 +0100 |
commit | 9de0c38159d4ef6a187545a35bb887ffdb123dce (patch) | |
tree | 848b9f188c09901e0ebff844c4e97ce13d90036b /src | |
parent | 80f89b23313cbad8cf7dd2f25ebf760debde54e7 (diff) | |
download | svg.js-9de0c38159d4ef6a187545a35bb887ffdb123dce.tar.gz svg.js-9de0c38159d4ef6a187545a35bb887ffdb123dce.zip |
Removing defs and references on clear()
Diffstat (limited to 'src')
-rw-r--r-- | src/container.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/container.js b/src/container.js index 5aac877..46ebdb1 100644 --- a/src/container.js +++ b/src/container.js @@ -156,10 +156,13 @@ SVG.extend(SVG.Container, { /* remove children */ for (var i = this.children().length - 1; i >= 0; i--) this.removeElement(this.children()[i]) - - /* create new defs node */ - this.defs() - + + /* remove defs node */ + if (this._defs) { + this._defs.remove() + delete this._defs + } + return this } |