Fix avoiding of name clashes in cloning.

This commit is contained in:
Jürg Lehni 2013-07-21 15:54:03 -07:00
parent aa4d990c90
commit 949752556b

View file

@ -1238,13 +1238,13 @@ var Item = Base.extend(Callback, /** @lends Item# */{
// Copy over the selection state, use setSelected so the item
// is also added to Project#selectedItems if it is selected.
copy.setSelected(this._selected);
// Insert is true by default.
if (insert || insert === undefined)
copy.insertAbove(this);
// Clone the name too, but make sure we're not overriding the original
// in the same parent, by passing true for the unique parameter.
if (this._name)
copy.setName(this._name, true);
// Insert is true by default.
if (insert || insert === undefined)
copy.insertAbove(this);
return copy;
},