diff options
author | wout <wout@impinc.co.uk> | 2014-06-25 15:27:31 +0200 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2014-06-25 15:27:31 +0200 |
commit | 859cf9fce39ea36ae40af8b828d4683b79746dee (patch) | |
tree | 2995d43addc248c70901f0c3231a7399c32aa7b1 /src | |
parent | 566407cb328263f1bf155401015da5f269d3dcb7 (diff) | |
download | svg.js-859cf9fce39ea36ae40af8b828d4683b79746dee.tar.gz svg.js-859cf9fce39ea36ae40af8b828d4683b79746dee.zip |
Added more versatility to adopter
Diffstat (limited to 'src')
-rw-r--r-- | src/adopter.js | 4 | ||||
-rwxr-xr-x | src/text.js | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/adopter.js b/src/adopter.js index 57e7691..5aa162c 100644 --- a/src/adopter.js +++ b/src/adopter.js @@ -13,8 +13,10 @@ SVG.adopt = function(node) { element = new SVG.Gradient('lineair') else if (node.nodeName == 'radialGradient') element = new SVG.Gradient('radial') - else + else if (SVG[capitalize(node.nodeName)]) element = new SVG[capitalize(node.nodeName)] + else + element = new SVG.Element(node) // Ensure references element.type = node.nodeName diff --git a/src/text.js b/src/text.js index 0581f88..843e3b6 100755 --- a/src/text.js +++ b/src/text.js @@ -131,7 +131,7 @@ SVG.Text = SVG.invent({ }) -SVG.TSpan = SVG.invent({ +SVG.Tspan = SVG.invent({ // Initialize node create: 'tspan' @@ -169,7 +169,7 @@ SVG.TSpan = SVG.invent({ }) -SVG.extend(SVG.Text, SVG.TSpan, { +SVG.extend(SVG.Text, SVG.Tspan, { // Create plain text node plain: function(text) { /* clear if build mode is disabled */ @@ -184,7 +184,7 @@ SVG.extend(SVG.Text, SVG.TSpan, { // Create a tspan , tspan: function(text) { var node = (this.textPath || this).node - , tspan = new SVG.TSpan + , tspan = new SVG.Tspan /* clear if build mode is disabled */ if (this._build === false) |