Changes between Version 1 and Version 2 of Ticket #10213


Ignore:
Timestamp:
Oct 27, 2009, 3:04:30 PM (13 years ago)
Author:
Eugene Lazutkin
Comment:

Fixing obvious bugs in the code keeping it recursive and with this.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #10213 – Description

    v1 v2  
    88{
    99  var ancestorNode = domNode.parentNode;
    10   if (ancestorNode != null)
    11   {
    12     if (ancestorNode.nodeName.toLowerCase() == ancestorNodeName.toLowerCase() )
    13     {
    14       return ancestorNode;     
    15     }
    16     else
    17     {
    18       this.findAncestorNodeByName(ancestorNodeName, ancestorNode);
    19     }
     10  if (ancestorNode && ancestorNode.nodeName.toLowerCase() ==
     11        ancestorNodeName.toLowerCase() ) {
     12    return ancestorNode;       
    2013  }
     14  return ancestorNode && this.findAncestorNodeByName(ancestorNodeName, ancestorNode);
    2115}
    2216}}}