From d0c34f778e854bd5f3e1c15d853bd126aad2d85d Mon Sep 17 00:00:00 2001 From: wout Date: Mon, 15 Apr 2013 12:04:41 +0100 Subject: Removing style attributes when empty --- src/element.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') 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 } -- cgit v1.2.3