function clickHandler(ev) {
  // only left clicks
  if (ev.button !== 0) return;

  var toggleEl = this;
  
  // exit if toggle button is disabled
  if (toggleEl.getAttribute('disabled') !== null) return;

  // let event bubble before toggling dropdown
  setTimeout(function() {
    if (!ev.defaultPrevented) toggleDropdown(toggleEl);
  }, 0);
}
/**
 * Handle click events on dropdown toggle element.
 * @param {Event} ev - The DOM event
 */
Handle click events on dropdown toggle element.
@param {Event} ev - The DOM event
Handle click events on dropdown toggle element . @param { Event } ev - The DOM event
function clickHandler(ev) {
  if (ev.button !== 0) return;
  var toggleEl = this;
  if (toggleEl.getAttribute('disabled') !== null) return;
  setTimeout(function() {
    if (!ev.defaultPrevented) toggleDropdown(toggleEl);
  }, 0);
}
function clickHandler ( ev ) { if ( ev . button !== 0 ) return ; var toggleEl = this ; if ( toggleEl . getAttribute ( 'disabled' ) !== null ) return ; setTimeout ( function ( ) { if ( ! ev . defaultPrevented ) toggleDropdown ( toggleEl ) ; } , 0 ) ; }
Handle click events on dropdown toggle element.
Handle click events on dropdown toggle element .
// only left clicks // exit if toggle button is disabled // let event bubble before toggling dropdown