function passedThrough(event, selector, stopAt) {
      var currentNode = event.target;
  
      while(true) {
        if(matchesFn.call(currentNode, selector)) {
          return currentNode;
        }
        else if(currentNode != stopAt && currentNode != document.body) {
          currentNode = currentNode.parentNode;
        }
        else {
          return false;
        }
      }
    }
/* Traverse DOM from event target up to parent, searching for selector */
Traverse DOM from event target up to parent, searching for selector
Traverse DOM from event target up to parent searching for selector
function passedThrough(event, selector, stopAt) {
      var currentNode = event.target;
      while(true) {
        if(matchesFn.call(currentNode, selector)) {
          return currentNode;
        }
        else if(currentNode != stopAt && currentNode != document.body) {
          currentNode = currentNode.parentNode;
        }
        else {
          return false;
        }
      }
    }
function passedThrough ( event , selector , stopAt ) { var currentNode = event . target ; while ( true ) { if ( matchesFn . call ( currentNode , selector ) ) { return currentNode ; } else if ( currentNode != stopAt && currentNode != document . body ) { currentNode = currentNode . parentNode ; } else { return false ; } } }
Traverse DOM from event target up to parent, searching for selector
Traverse DOM from event target up to parent searching for selector