mirror of
https://github.com/konvajs/konva.git
synced 2026-01-09 11:34:38 +08:00
added validation for add(). An error is thrown if an invalid node is added
This commit is contained in:
@@ -47,6 +47,11 @@
|
||||
this._bindContentEvents();
|
||||
Kinetic.Global.stages.push(this);
|
||||
},
|
||||
_validateAdd: function(child) {
|
||||
if (child.getType() !== 'Layer') {
|
||||
Kinetic.Util.error('You may only add layers to the stage.');
|
||||
}
|
||||
},
|
||||
/**
|
||||
* set container dom element which contains the stage wrapper div element
|
||||
* @method
|
||||
|
||||
Reference in New Issue
Block a user