aboutsummaryrefslogtreecommitdiffstats
path: root/src/svg.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2013-03-06 21:17:37 +0000
committerwout <wout@impinc.co.uk>2013-03-06 21:17:37 +0000
commitb75df7a1c5b0260070de9bc535e9917c100c6035 (patch)
tree076b8aa8227d17894a4c9f0e6e175802a6b08937 /src/svg.js
parent5e3ff072994d3d9b224c62d71ca1331951249bac (diff)
downloadsvg.js-b75df7a1c5b0260070de9bc535e9917c100c6035.tar.gz
svg.js-b75df7a1c5b0260070de9bc535e9917c100c6035.zip
Animatable fill() and stroke()
Diffstat (limited to 'src/svg.js')
-rw-r--r--src/svg.js16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/svg.js b/src/svg.js
index e56086b..e7f4363 100644
--- a/src/svg.js
+++ b/src/svg.js
@@ -36,9 +36,19 @@ this.SVG = {
return element
}
// Method for extending objects
-, extend: function(object, module) {
- for (var key in module)
- object.prototype[key] = module[key]
+, extend: function() {
+ var modules, methods, key, i
+
+ /* get list of modules */
+ modules = Array.prototype.slice.call(arguments)
+
+ /* get object with extensions */
+ methods = modules.pop()
+
+ for (i = modules.length - 1; i >= 0; i--)
+ if (modules[i])
+ for (key in methods)
+ modules[i].prototype[key] = methods[key]
}
}