diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2015-06-27 14:00:58 +0200 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2015-06-27 14:00:58 +0200 |
commit | afcce62e95d86324b81f7cd0fa9ce18c59f5902d (patch) | |
tree | 08da395e37af8182814a426f3aece673463d67b7 /src/bare.js | |
parent | c6dc3c9a9d5c7572cb72d684f0306c001ca1f3c5 (diff) | |
download | svg.js-afcce62e95d86324b81f7cd0fa9ce18c59f5902d.tar.gz svg.js-afcce62e95d86324b81f7cd0fa9ce18c59f5902d.zip |
Fixed bug in SVG.Bare (closes #358)
Diffstat (limited to 'src/bare.js')
-rw-r--r-- | src/bare.js | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/src/bare.js b/src/bare.js index a0b1ee3..a045165 100644 --- a/src/bare.js +++ b/src/bare.js @@ -1,45 +1,45 @@ SVG.Bare = SVG.invent({ - // Initialize - create: function(element, inherit) { - // construct element - this.constructor.call(this, SVG.create(element)) - - // inherit custom methods - if (inherit) - for (var method in inherit.prototype) - if (typeof inherit.prototype[method] === 'function') - element[method] = inherit.prototype[method] - } - - // Inherit from + // Initialize + create: function(element, inherit) { + // construct element + this.constructor.call(this, SVG.create(element)) + + // inherit custom methods + if (inherit) + for (var method in inherit.prototype) + if (typeof inherit.prototype[method] === 'function') + this[method] = inherit.prototype[method] + } + + // Inherit from , inherit: SVG.Element - - // Add methods + + // Add methods , extend: { - // Insert some plain text - words: function(text) { - // remove contents - while (this.node.hasChildNodes()) - this.node.removeChild(this.node.lastChild) + // Insert some plain text + words: function(text) { + // remove contents + while (this.node.hasChildNodes()) + this.node.removeChild(this.node.lastChild) // create text node this.node.appendChild(document.createTextNode(text)) return this - } - } + } + } }) SVG.extend(SVG.Parent, { - // Create an element that is not described by SVG.js - element: function(element, inherit) { - return this.put(new SVG.Bare(element, inherit)) - } - // Add symbol element + // Create an element that is not described by SVG.js + element: function(element, inherit) { + return this.put(new SVG.Bare(element, inherit)) + } + // Add symbol element , symbol: function() { - return this.defs().element('symbol', SVG.Container) - } + return this.defs().element('symbol', SVG.Container) + } })
\ No newline at end of file |