Use #setChildren() in Group constructor and allow passing of children both as arguments and inside an array.

This commit is contained in:
Jürg Lehni 2011-05-16 20:16:27 +01:00
parent baf35ea18c
commit 889b1687f9

View file

@ -21,12 +21,9 @@ var Group = this.Group = Item.extend({
this.base();
this._children = [];
this._namedChildren = {};
if (items) {
for (var i = 0, l = items.length; i < l; i++) {
this.appendTop(items[i]);
}
}
this._clipped = false;
this.setChildren(!items || !Array.isArray(items)
|| typeof items[0] !== 'object' ? arguments : items);
},
/**