diff options
author | wout <wout@impinc.co.uk> | 2014-01-25 14:34:03 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2014-01-25 14:34:03 +0100 |
commit | b48f03348ba04fb875c193f7e630fb35601bd9fe (patch) | |
tree | 573a2a9ff6f3b839c151d89f86a095bb3c98a87a /src/hyperlink.js | |
parent | 70879728a81c7bcee9f509a96b23443d35c912aa (diff) | |
download | svg.js-b48f03348ba04fb875c193f7e630fb35601bd9fe.tar.gz svg.js-b48f03348ba04fb875c193f7e630fb35601bd9fe.zip |
Added addTo() and putIn() methods, added more detailed documentation
Diffstat (limited to 'src/hyperlink.js')
-rw-r--r-- | src/hyperlink.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/hyperlink.js b/src/hyperlink.js index 9feea30..7b9d986 100644 --- a/src/hyperlink.js +++ b/src/hyperlink.js @@ -29,4 +29,20 @@ SVG.extend(SVG.Container, { return this.put(new SVG.A).to(url) } +}) + +// +SVG.extend(SVG.Element, { + // Create a hyperlink element + linkTo: function(url) { + var link = new SVG.A + + if (typeof url == 'function') + url.call(link, link) + else + link.to(url) + + return this.parent.put(link).put(this) + } + })
\ No newline at end of file |