diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2015-02-22 16:25:37 +0100 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2015-02-22 16:25:37 +0100 |
commit | e5b321e1c49928d5e7fceeeedec7fde91aa5e0f0 (patch) | |
tree | c1761e94f8cbdbf08388b07588c03c85b3189a1a /src | |
parent | 095b474e110f7ed7f5920ca297607b58ed351128 (diff) | |
download | svg.js-e5b321e1c49928d5e7fceeeedec7fde91aa5e0f0.tar.gz svg.js-e5b321e1c49928d5e7fceeeedec7fde91aa5e0f0.zip |
Fixes #326
drawing.remove() now calls destroy() to remove the doc from the DOM
Diffstat (limited to 'src')
-rwxr-xr-x | src/doc.js | 8 | ||||
-rwxr-xr-x | src/element.js | 2 |
2 files changed, 9 insertions, 1 deletions
@@ -78,6 +78,14 @@ SVG.Doc = SVG.invent({ return this } + + // Removes the doc from the DOM + , destroy: function() { + this.parent.removeChild(this.node); + this.parent = null; + + return this; + } } }) diff --git a/src/element.js b/src/element.js index 8c4166d..438f5a9 100755 --- a/src/element.js +++ b/src/element.js @@ -101,7 +101,7 @@ SVG.Element = SVG.invent({ // Remove element , remove: function() { if (this.parent) - this.parent.removeElement(this) + this.doc() === this ? this.destroy() : this.parent.removeElement(this) return this } |