diff options
author | wout <wout@impinc.co.uk> | 2012-12-21 21:01:03 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2012-12-21 21:01:03 +0100 |
commit | cf1bd17eebe9b6cb8fac869aeec4245a0ec66fff (patch) | |
tree | 222e58dd0bb2729b237dafd22ba7077456c2b003 /dist/svg.js | |
parent | 9dd851e68a3241883dea7236da48d4878b1b1899 (diff) | |
download | svg.js-cf1bd17eebe9b6cb8fac869aeec4245a0ec66fff.tar.gz svg.js-cf1bd17eebe9b6cb8fac869aeec4245a0ec66fff.zip |
Making the svg function global
Diffstat (limited to 'dist/svg.js')
-rw-r--r-- | dist/svg.js | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/dist/svg.js b/dist/svg.js index 82d55eb..9baa57e 100644 --- a/dist/svg.js +++ b/dist/svg.js @@ -1,4 +1,4 @@ -/* svg.js v0.1 - svg container element group arrange defs clip doc shape rect circle ellipse path image text sugar - svgjs.com/license */ +/* svg.js v0.1-1-g9dd851e - svg container element group arrange defs clip doc shape rect circle ellipse path image text sugar - svgjs.com/license */ (function() { this.SVG = { @@ -15,7 +15,7 @@ } }; - this.svg = function(e) { + window.svg = function(e) { return new SVG.Doc(e); }; @@ -528,7 +528,7 @@ // (re)load image load: function(u) { - return this.attr('href', u, SVG.xlink); + return this.attr('xlink:href', u, SVG.xlink); } }); @@ -551,7 +551,8 @@ this.content = t = t || 'text'; this.lines = []; - var i, s, + var i, n, + s = this._style(), p = this.parentDoc(), a = t.split("\n"); @@ -559,19 +560,19 @@ this.node.removeChild(this.node.lastChild); for (i = 0, l = a.length; i < l; i++) { - s = new TSpan(). + n = new TSpan(). text(a[i]). attr({ dy: this.style['font-size'] * this.leading, x: (this.attr('x') || 0), - style: this._style() + style: s }); - this.node.appendChild(s.node); - this.lines.push(s); + this.node.appendChild(n.node); + this.lines.push(n); }; - return this; + return this.attr('style', s); }, _style: function() { |