mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Simplify Item#_removeFromParent().
This commit is contained in:
parent
4e059af684
commit
5593eb94d0
1 changed files with 3 additions and 5 deletions
|
@ -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;
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue