* @copyright Wout Fierens <wout@mick-wout.com>
* @license MIT
*
-* BUILT: Wed Mar 29 2017 16:04:59 GMT+0200 (Mitteleuropäische Sommerzeit)
+* BUILT: Sun Apr 09 2017 16:00:39 GMT+0200 (Mitteleuropäische Sommerzeit)
*/;
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// Removes the doc from the DOM
, remove: function() {
if(this.parent()) {
- this.parent().removeChild(this.node);
+ this.parent().removeChild(this.node)
}
- return this;
+ return this
}
, clear: function() {
// remove children
})
describe('remove()', function() {
- it('removes the doc from the dom', function() {
+ it('removes the doc from the dom only if doc is not root element', function() {
var cnt = window.document.querySelectorAll('svg').length
draw.remove()
- expect(window.document.querySelectorAll('svg').length).toBe(cnt-1)
+ if(parserInDoc){
+ expect(window.document.querySelectorAll('svg').length).toBe(cnt)
+ }else{
+ expect(window.document.querySelectorAll('svg').length).toBe(cnt-1)
+ }
+
draw = SVG(drawing).size(100,100);
expect(window.document.querySelectorAll('svg').length).toBe(cnt)
})
// Removes the doc from the DOM
, remove: function() {
if(this.parent()) {
- this.parent().removeChild(this.node);
+ this.parent().removeChild(this.node)
}
- return this;
+ return this
}
, clear: function() {
// remove children