aboutsummaryrefslogtreecommitdiffstats
path: root/src/svg.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/svg.js')
-rw-r--r--src/svg.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/svg.js b/src/svg.js
index ec3ba71..525df38 100644
--- a/src/svg.js
+++ b/src/svg.js
@@ -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 &&