summaryrefslogtreecommitdiffstats
path: root/src/hyperlink.js
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2018-10-25 23:26:38 +0200
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2018-10-25 23:26:38 +0200
commit464af8b747389b7fdb569a933591c863b9be0f6b (patch)
treea23da0d70a26c142616207b0a0a489affd2f3ac6 /src/hyperlink.js
parentf46aedf58fbc93483cb21017ffed10e439830108 (diff)
downloadsvg.js-464af8b747389b7fdb569a933591c863b9be0f6b.tar.gz
svg.js-464af8b747389b7fdb569a933591c863b9be0f6b.zip
Rename files so that they reflect their exported classes (see next commit)
Diffstat (limited to 'src/hyperlink.js')
-rw-r--r--src/hyperlink.js41
1 files changed, 0 insertions, 41 deletions
diff --git a/src/hyperlink.js b/src/hyperlink.js
deleted file mode 100644
index cb0a341..0000000
--- a/src/hyperlink.js
+++ /dev/null
@@ -1,41 +0,0 @@
-SVG.A = SVG.invent({
- // Initialize node
- create: 'a',
-
- // Inherit from
- inherit: SVG.Container,
-
- // Add class methods
- extend: {
- // Link url
- to: function (url) {
- return this.attr('href', url, SVG.xlink)
- },
- // Link target attribute
- target: function (target) {
- return this.attr('target', target)
- }
- },
-
- // Add parent method
- construct: {
- // Create a hyperlink element
- link: function (url) {
- 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)
- }
-
-})