Opened 12 years ago
Closed 12 years ago
#7547 closed enhancement (fixed)
Remove unnecessary code
Reported by: | Eugene Lazutkin | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.2 |
Component: | Dijit | Version: | 1.1.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Due to fixing bugs in dojo.place(), the explicit use of the default parameter is not required anymore. Following snippet from the beginning of dijit._Container.addChild() can be safely removed:
if(insertIndex === undefined){ insertIndex = "last"; }
Change History (6)
comment:1 Changed 12 years ago by
comment:3 Changed 12 years ago by
Milestone: | tbd → 1.2 |
---|
Seems like we can get rid of the next block too:
var refNode = this.containerNode; if(insertIndex && typeof insertIndex == "number"){ var children = dojo.query("> [widgetId]", refNode); if(children && children.length >= insertIndex){ refNode = children[insertIndex-1]; insertIndex = "after"; } }
comment:4 Changed 12 years ago by
I am not so sure. dojo.placw works with all node's children, while this snippet works only with children that have "widgetId" attribute set. Please verify that removing this condition will not break the function.
comment:5 Changed 12 years ago by
Owner: | set to bill |
---|---|
Status: | new → assigned |
Hmm, good point. In general all child nodes of this.containerNode are widgets, but I suppose that's not guaranteed (although I notice that getNextSibling() / getPreviousSibling() will break if that isn't the case).
I'll just remove those three lines for now.
comment:6 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
The corresponding ticket for Dojo Core is #7547.