Merge pull request #216 from tshinnic/dedupe_group_make

cleanup duplicate code on group Element creation  (not a bug)
master
Dmitry Baranovskiy 2014-03-25 16:02:10 +11:00
commit c58fc82583
1 changed files with 1 additions and 6 deletions

View File

@ -2507,7 +2507,6 @@ function make(name, parent) {
var res = $(name); var res = $(name);
parent.appendChild(res); parent.appendChild(res);
var el = wrap(res); var el = wrap(res);
el.type = name;
return el; return el;
} }
function Paper(w, h) { function Paper(w, h) {
@ -2909,10 +2908,6 @@ function gradientRadial(defs, cx, cy, r, fx, fy) {
\*/ \*/
proto.group = proto.g = function (first) { proto.group = proto.g = function (first) {
var el = make("g", this.node); var el = make("g", this.node);
el.add = add2group;
for (var method in proto) if (proto[has](method)) {
el[method] = proto[method];
}
if (arguments.length == 1 && first && !first.type) { if (arguments.length == 1 && first && !first.type) {
el.attr(first); el.attr(first);
} else if (arguments.length) { } else if (arguments.length) {
@ -3711,4 +3706,4 @@ Snap.plugin = function (f) {
}; };
glob.win.Snap = Snap; glob.win.Snap = Snap;
return Snap; return Snap;
}()); }());