diff options
author | wout <wout@impinc.co.uk> | 2013-03-24 19:19:06 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2013-03-24 19:19:06 +0100 |
commit | 67d367e0d74b3287956130da0077e42c6483dd2f (patch) | |
tree | bb2d23315e39c89b79cb8c52e7a5db54636e08ad /src/svg.js | |
parent | ff09596144c3fd6770d1dc64178a10c2432396ca (diff) | |
download | svg.js-67d367e0d74b3287956130da0077e42c6483dd2f.tar.gz svg.js-67d367e0d74b3287956130da0077e42c6483dd2f.zip |
Bumped to v0.11
- removed SVG.Wrap on SVG.Polyline, SVG.Polygon and SVG.Path
- added delay on SVG.FX module
- made x(), y(), cx() and cy() as getters
- added SGB.get() method, to get elements by a DOM id
- fixed bug in remove() method on container elements
- added jasmine test suite to repo
Diffstat (limited to 'src/svg.js')
-rw-r--r-- | src/svg.js | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -27,7 +27,7 @@ SVG.did = 1000 // Get next named element id SVG.eid = function(name) { - return 'Svgjs' + name.charAt(0).toUpperCase() + name.slice(1) + 'Element' + (SVG.did++) + return 'Svgjs' + name.charAt(0).toUpperCase() + name.slice(1) + (SVG.did++) } // Method for element creation @@ -41,7 +41,7 @@ SVG.create = function(name) { return element } - // Method for extending objects +// Method for extending objects SVG.extend = function() { var modules, methods, key, i @@ -57,6 +57,12 @@ SVG.extend = function() { modules[i].prototype[key] = methods[key] } +// Method for getting an eleemnt by id +SVG.get = function(id) { + var node = document.getElementById(id) + if (node) return node.instance +} + // svg support test SVG.supported = (function() { return !! document.createElementNS && |