diff options
author | wout <wout@impinc.co.uk> | 2013-04-15 12:04:41 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2013-04-15 12:04:41 +0100 |
commit | d0c34f778e854bd5f3e1c15d853bd126aad2d85d (patch) | |
tree | 409f40cf2fe69aef513676e59a2d88d8f069d25b /src/element.js | |
parent | 801a9e1bfb6ff2fb31d00f9bc71b9af1175395bb (diff) | |
download | svg.js-d0c34f778e854bd5f3e1c15d853bd126aad2d85d.tar.gz svg.js-d0c34f778e854bd5f3e1c15d853bd126aad2d85d.zip |
Removing style attributes when empty
Diffstat (limited to 'src/element.js')
-rw-r--r-- | src/element.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/element.js b/src/element.js index efcd2e3..3665dc2 100644 --- a/src/element.js +++ b/src/element.js @@ -303,7 +303,10 @@ SVG.extend(SVG.Element, { s += v + ':' + this.styles[v] + ';' /* apply style */ - this.node.setAttribute('style', s) + if (s == '') + this.node.removeAttribute('style') + else + this.node.setAttribute('style', s) return this } |