From 07839cf683cf8c82bd4b08d9d2769fcbf06616d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 12 Nov 2011 15:50:35 +0100 Subject: [PATCH] Add comment about name being set again in addChild(). --- src/item/Item.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/item/Item.js b/src/item/Item.js index 6ff1a4e1..e69d2b3c 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -822,6 +822,8 @@ var Item = this.Item = Base.extend(/** @lends Item# */{ Base.splice(this._children, [item], index, 0); item._parent = this; item._setProject(this._project); + // Setting the name again makes sure all name lookup structures are + // kept in sync. if (item._name) item.setName(item._name); this._changed(Change.HIERARCHY);