Simplify Item#_removeFromParent().

This commit is contained in:
Jürg Lehni 2011-05-14 18:11:31 +01:00
parent 4e059af684
commit 5593eb94d0

View file

@ -294,11 +294,9 @@ var Item = this.Item = Base.extend({
*/
_removeFromParent: function() {
if (this._parent) {
var ok = !!Base.splice(this._parent._children, null,
this._index, 1).length;
this._parent = null;
this._index = null;
return ok;
var res = Base.splice(this._parent._children, null, this._index, 1);
this._parent = this._index = null;
return !!res.length;
}
return false;
},