From 949752556bd03bb3f344b7a763ea8c7b8a36a0a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 21 Jul 2013 15:54:03 -0700 Subject: [PATCH] Fix avoiding of name clashes in cloning. --- src/item/Item.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/item/Item.js b/src/item/Item.js index e6364fe1..6f54b80d 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -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; },