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) {
var parent = this, isDescendant = false;
while(parent = parent.parent) {
if(parent.children.indexOf(item) != -1) {
while(parent) {
if(parent == item) {
isDescendant = true;
break;
}
parent = parent.parent;
}
return isDescendant;
}