From b75df7a1c5b0260070de9bc535e9917c100c6035 Mon Sep 17 00:00:00 2001 From: wout Date: Wed, 6 Mar 2013 21:17:37 +0000 Subject: Animatable fill() and stroke() --- src/svg.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/svg.js') 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] } } -- cgit v1.2.3