added validation for add(). An error is thrown if an invalid node is added

This commit is contained in:
Eric Rowell
2013-07-22 22:47:13 -07:00
parent 1fc57bed4c
commit 3eea92d72e
6 changed files with 126 additions and 2 deletions

View File

@@ -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