Commit 47addb3c by Dmitry Baranovskiy

Fixed plugins.

parent b600ebcb
...@@ -591,21 +591,24 @@ window.Raphael = (function () { ...@@ -591,21 +591,24 @@ window.Raphael = (function () {
} }
}, },
plugins = function (con, add) { plugins = function (con, add) {
for (var prop in add) if (add.hasOwnProperty(prop) && !(prop in con)) { var that = this;
switch (typeof add[prop]) { for (var prop in add) if (add.hasOwnProperty(prop) && !(prop in con)) {
case "function": switch (typeof add[prop]) {
con[prop] = con === this ? add[prop] : function () { return add[prop].apply(this, arguments); }; case "function":
break; (function (f) {
case "object": con[prop] = con === that ? f : function () { return f.apply(that, arguments); };
con[prop] = {}; })(add[prop]);
plugins.call(this, con[prop], add[prop]); break;
break; case "object":
default: con[prop] = con[prop] || {};
con[prop] = add[prop]; plugins.call(this, con[prop], add[prop]);
break; break;
default:
con[prop] = add[prop];
break;
}
} }
} };
};
// SVG // SVG
if (R.svg) { if (R.svg) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment