Fix Item#isDescendant(item).

This commit is contained in:
Jonathan Puckey 2011-02-12 16:36:48 +01:00
parent d7fc9cf481
commit e9e987f304

View file

@ -291,11 +291,12 @@ Item = Base.extend({
*/ */
isDescendant: function(item) { isDescendant: function(item) {
var parent = this, isDescendant = false; var parent = this, isDescendant = false;
while(parent = parent.parent) { while(parent) {
if(parent.children.indexOf(item) != -1) { if(parent == item) {
isDescendant = true; isDescendant = true;
break; break;
} }
parent = parent.parent;
} }
return isDescendant; return isDescendant;
} }