Allow CompoundPath to have named children.

This commit is contained in:
Jürg Lehni 2011-06-17 14:11:37 +01:00
parent e2b7d4c924
commit 503a031bdf
2 changed files with 3 additions and 0 deletions

View file

@ -69,6 +69,7 @@ var Group = this.Group = Item.extend({
*/
initialize: function(items) {
this.base();
// Allow Group to have children and named children
this._children = [];
this._namedChildren = {};
this.setChildren(!items || !Array.isArray(items)

View file

@ -42,7 +42,9 @@ var CompoundPath = this.CompoundPath = PathItem.extend({
*/
initialize: function(paths) {
this.base();
// Allow CompoundPath to have children and named children.
this._children = [];
this._namedChildren = {};
// Do not reassign to paths, since arguments would get modified, which
// we potentially use as array, depending on what is passed.
var items = !paths || !Array.isArray(paths)