aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2013-04-15 12:04:41 +0100
committerwout <wout@impinc.co.uk>2013-04-15 12:04:41 +0100
commitd0c34f778e854bd5f3e1c15d853bd126aad2d85d (patch)
tree409f40cf2fe69aef513676e59a2d88d8f069d25b /src
parent801a9e1bfb6ff2fb31d00f9bc71b9af1175395bb (diff)
downloadsvg.js-d0c34f778e854bd5f3e1c15d853bd126aad2d85d.tar.gz
svg.js-d0c34f778e854bd5f3e1c15d853bd126aad2d85d.zip
Removing style attributes when empty
Diffstat (limited to 'src')
-rw-r--r--src/element.js5
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
}