cleaned up isAncestorOf logic. stage should not be an ancestor of self. plus this was bad OO design

This commit is contained in:
ericdrowell 2012-09-25 16:30:13 -07:00
parent 2b99a88b7e
commit b757342b11
3 changed files with 3 additions and 11 deletions

View File

@ -2586,10 +2586,6 @@ Kinetic.Container.prototype = {
* @param {Kinetic.Node} node
*/
isAncestorOf: function(node) {
if(this.nodeType === 'Stage') {
return true;
}
var parent = node.getParent();
while(parent) {
if(parent._id === this._id) {

File diff suppressed because one or more lines are too long

View File

@ -198,10 +198,6 @@ Kinetic.Container.prototype = {
* @param {Kinetic.Node} node
*/
isAncestorOf: function(node) {
if(this.nodeType === 'Stage') {
return true;
}
var parent = node.getParent();
while(parent) {
if(parent._id === this._id) {