mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Clear Item#_index when removing item and simplify #getIndex().
This commit is contained in:
parent
25c2d68f37
commit
de34f8c157
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue