diff options
author | wout <wout@impinc.co.uk> | 2014-01-23 21:18:43 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2014-01-23 21:18:43 +0100 |
commit | aaaf8f1f3ee676e5733f50114aff5717481f3bcf (patch) | |
tree | 3371202c48a76d02e01267114c14f7f65ad47e96 /dist/svg.js | |
parent | 820b56214181b561212e2b7ef2a3c636bcb836c8 (diff) | |
download | svg.js-aaaf8f1f3ee676e5733f50114aff5717481f3bcf.tar.gz svg.js-aaaf8f1f3ee676e5733f50114aff5717481f3bcf.zip |
Added the hyperlink element
Diffstat (limited to 'dist/svg.js')
-rw-r--r-- | dist/svg.js | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/dist/svg.js b/dist/svg.js index a60f378..a7ad178 100644 --- a/dist/svg.js +++ b/dist/svg.js @@ -1,4 +1,4 @@ -/* svg.js v0.34 - svg regex default color array number viewbox bbox rbox element parent container fx event defs group arrange mask clip gradient doc shape use rect ellipse line poly path image text textpath nested sugar set memory loader - svgjs.com/license */ +/* svg.js v0.35 - svg regex default color array number viewbox bbox rbox element parent container fx event defs group arrange mask clip gradient doc shape use rect ellipse line poly path image text textpath nested hyperlink sugar set memory loader - svgjs.com/license */ ;(function() { this.SVG = function(element) { @@ -2825,6 +2825,39 @@ }) + SVG.A = function() { + this.constructor.call(this, SVG.create('a')) + } + + // Inherit from SVG.Parent + SVG.A.prototype = new SVG.Container + + // + SVG.extend(SVG.A, { + // Link url + to: function(url) { + return this.attr('href', url, SVG.xlink) + } + // Link show attribute + , show: function(target) { + return this.attr('show', target, SVG.xlink) + } + // Link target attribute + , target: function(target) { + return this.attr('target', target) + } + + }) + + // + SVG.extend(SVG.Container, { + // Create a hyperlink element + link: function(url) { + return this.put(new SVG.A).to(url) + } + + }) + SVG._stroke = ['color', 'width', 'opacity', 'linecap', 'linejoin', 'miterlimit', 'dasharray', 'dashoffset'] SVG._fill = ['color', 'opacity', 'rule'] |