Rename #_removeFromParent() -> #_remove().

This commit is contained in:
Jürg Lehni 2011-06-19 17:32:43 +01:00
parent 4eb6d78f1f
commit 812d3fb366
2 changed files with 6 additions and 6 deletions

View file

@ -665,7 +665,7 @@ var Item = this.Item = Base.extend({
*/
insertChild: function(index, item) {
if (this._children) {
item._removeFromParent(false, true);
item._remove(false, true);
Base.splice(this._children, [item], index, 0);
item._parent = this;
item._setProject(this._project);
@ -773,7 +773,7 @@ var Item = this.Item = Base.extend({
/**
* Removes the item from its parent's children list.
*/
_removeFromParent: function(deselect, notify) {
_remove: function(deselect, notify) {
if (this._parent) {
if (deselect)
this.setSelected(false);
@ -796,7 +796,7 @@ var Item = this.Item = Base.extend({
* @return {Boolean} {@true the item was removed}
*/
remove: function() {
return this._removeFromParent(true, true);
return this._remove(true, true);
},
/**
@ -826,7 +826,7 @@ var Item = this.Item = Base.extend({
to = Base.pick(to, this._children.length);
var removed = this._children.splice(from, to - from);
for (var i = removed.length - 1; i >= 0; i--)
removed[i]._removeFromParent(true, false);
removed[i]._remove(true, false);
if (removed.length > 0)
this._changed(ChangeFlags.HIERARCHY);
return removed;

View file

@ -53,7 +53,7 @@ var Layer = this.Layer = Group.extend({
* Removes the layer from its project's layers list
* or its parent's children list.
*/
_removeFromParent: function(deselect, notify) {
_remove: function(deselect, notify) {
if (this._parent)
return this.base(deselect, notify);
if (this._index != null) {
@ -94,7 +94,7 @@ var Layer = this.Layer = Group.extend({
// If the item is a layer and contained within Project#layers, use
// our own version of move().
if (item instanceof Layer && !item._parent
&& this._removeFromParent(false, true)) {
&& this._remove(false, true)) {
Base.splice(item._project.layers, [this],
item._index + (above ? 1 : -1), 0);
this._setProject(item._project);