From de34f8c1577b90cf2051ae641c75125fd46bbd79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 14 May 2011 17:56:56 +0100 Subject: [PATCH] Clear Item#_index when removing item and simplify #getIndex(). --- src/item/Item.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/item/Item.js b/src/item/Item.js index c7b9c950..206308ac 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -272,7 +272,7 @@ var Item = this.Item = Base.extend({ * The index of this item within the list of it's parent's children. */ getIndex: function() { - return this._index !== undefined ? this._index : null; + return this._index; }, /** @@ -283,6 +283,7 @@ var Item = this.Item = Base.extend({ var ok = !!Base.splice(this._parent.children, null, this._index, 1).length; this._parent = null; + this._index = null; return ok; } return false;