mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +08:00
19 lines
600 B
JavaScript
19 lines
600 B
JavaScript
(function() {
|
|
Kinetic.Util.addMethods(Kinetic.Group, {
|
|
___init: function(config) {
|
|
this.nodeType = 'Group';
|
|
// call super constructor
|
|
Kinetic.Container.call(this, config);
|
|
},
|
|
_validateAdd: function(child) {
|
|
var type = child.getType();
|
|
if (type !== 'Group' && type !== 'Shape') {
|
|
Kinetic.Util.error('You may only add groups and shapes to groups.');
|
|
}
|
|
}
|
|
});
|
|
Kinetic.Util.extend(Kinetic.Group, Kinetic.Container);
|
|
|
|
Kinetic.Collection.mapMethods(Kinetic.Group);
|
|
})();
|