From 889b1687f99be5b1cb0f304a7259a5c33dfe9090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Mon, 16 May 2011 20:16:27 +0100 Subject: [PATCH] Use #setChildren() in Group constructor and allow passing of children both as arguments and inside an array. --- src/item/Group.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/item/Group.js b/src/item/Group.js index 60bb6389..dcf37d3e 100644 --- a/src/item/Group.js +++ b/src/item/Group.js @@ -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); }, /**