util.js
function closest(element, test) {
  var el = element;

  while (el) {
    if (test(el)) {
      return el;
    }
    el = el.parentNode;
  }

  return null;
}
function closest(element, test) {
  var el = element;

  while (el) {
    if (test(el)) {
      return el;
    }
    el = el.parentNode;
  }

  return null;
}
function closest ( element , test ) { var el = element ; while ( el ) { if ( test ( el ) ) { return el ; } el = el . parentNode ; } return null ; }
Find first element that tests true, starting with the element itself
and traversing up through its ancestors
@param  {Element} element
@param  {Function} test fn - return true when element located
@return {Element}
Find first element that tests true starting with the element itself and traversing up through its ancestors