Changes between Initial Version and Version 1 of Ticket #17547


Ignore:
Timestamp:
Nov 5, 2013, 2:59:58 PM (6 years ago)
Author:
Jared Jurkiewicz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #17547 – Description

    initial v1  
    1111A simple fix for this is probably just adding a check to refNode before going into that loop.  Example:
    1212
    13                 addChild: function(/*dijit/_WidgetBase*/ widget, /*int?*/ insertIndex){
    14                         // summary:
    15                         //              Makes the given widget a child of this widget.
    16                         // description:
    17                         //              Inserts specified child widget's dom node as a child of this widget's
    18                         //              container node, and possibly does other processing (such as layout).
    19 
    20                         // I want to just call domConstruct.place(widget.domNode, this.containerNode, insertIndex), but the counting
    21                         // is thrown off by text nodes and comment nodes that show up when constructed by markup.
    22                         // In the future consider stripping those nodes on construction, either in the parser or this widget code.
    2313                        var refNode = this.containerNode;
    2414                        if(insertIndex > 0){
     
    2616                                // in #10087 to minimize download size.   Not sure if that's still and issue with new smaller dojo/query.
    2717                                refNode = refNode.firstChild;
    28                                 if(refNode){ // Make sure containerNode had a first child, otherwise just fall through to adding this as the first child.
    29                                         while(insertIndex > 0){
    30                                                 if(refNode.nodeType == 1){ insertIndex--; }
    31                                                 refNode = refNode.nextSibling;
    32                                         }
     18                                while('''refNode''' && insertIndex > 0){
     19                                        if(refNode.nodeType == 1){ insertIndex--; }
     20                                        refNode = refNode.nextSibling;
    3321                                }
    3422                                if(refNode){