From 6c6c82ed59533f44f8754b69d47e3b11cd6dd129 Mon Sep 17 00:00:00 2001 From: wout Date: Sat, 9 Mar 2013 22:28:47 +0100 Subject: Bumped to v0.9, added better style management, text support and extended animation functionality --- src/sugar.js | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src/sugar.js') diff --git a/src/sugar.js b/src/sugar.js index 14868e3..1f7339a 100644 --- a/src/sugar.js +++ b/src/sugar.js @@ -63,23 +63,19 @@ SVG.extend(SVG.Element, SVG.FX, { if (SVG.Text) { - SVG.extend(SVG.Text, { + SVG.extend(SVG.Text, SVG.FX, { // Set font font: function(o) { - var key, attr = {} - - for (key in o) - key == 'leading' ? - attr[key] = o[key] : + for (var key in o) key == 'anchor' ? - attr['text-anchor'] = o[key] : + this.attr('text-anchor', o[key]) : _styleAttr.indexOf(key) > -1 ? - attr['font-'+ key] = o[key] : - void 0 - - return this.attr(attr).text(this.content) + this.attr('font-'+ key, o[key]) : + this.attr(key, o[key]) + + return this } - + }) } -- cgit v1.2.3