function toggleExpandedState( elems, state, cb, delay ) {
  var navTimeout;
  if ( elems.constructor !== NodeList &&
       elems.constructor !== Array ) {
    elems = [ elems ];
  }

  delay = delay || 300;
  state = state || !isOneExpanded( elems );

  for ( var i = 0, len = elems.length; i < len; i++ ) {
    elems[i].setAttribute( 'aria-expanded', state );
  }

  if ( cb ) {
    clearTimeout( navTimeOut );

    navTimeOut = setTimeout( function() {
      return cb();
    }, delay );
  }
}
/**
 * Change the value of the element's aria-expanded attribute based on it's
 * current state if one is not passed. Allows for a delayed event for
 * animated elements.
 * @param {NodeList|Array|HTMLNode} elems
 *   List of elements or single element on which to set
 *   the aria-expanded attribute.
 * @param {string} state The value, if any, to set the aria-expanded
 *   attribute to. Options are "true", "false" or null.
 * @param {Function} cb The callback function to execute after a delay.
 * @param {integer} delay The length of time to delay the execution of
 *   the passed callback.
 */
Change the value of the element's aria-expanded attribute based on it's
current state if one is not passed. Allows for a delayed event for
animated elements.
@param {NodeList|Array|HTMLNode} elems
List of elements or single element on which to set
the aria-expanded attribute.
@param {string} state The value, if any, to set the aria-expanded
attribute to. Options are "true", "false" or null.
@param {Function} cb The callback function to execute after a delay.
@param {integer} delay The length of time to delay the execution of
the passed callback.
Change the value of the element ' s aria - expanded attribute based on it ' s current state if one is not passed . Allows for a delayed event for animated elements . @param { NodeList|Array|HTMLNode } elems List of elements or single element on which to set the aria - expanded attribute . @param { string } state The value if any to set the aria - expanded attribute to . Options are " true " " false " or null . @param { Function } cb The callback function to execute after a delay . @param { integer } delay The length of time to delay the execution of the passed callback .
function toggleExpandedState( elems, state, cb, delay ) {
  var navTimeout;
  if ( elems.constructor !== NodeList &&
       elems.constructor !== Array ) {
    elems = [ elems ];
  }
  delay = delay || 300;
  state = state || !isOneExpanded( elems );
  for ( var i = 0, len = elems.length; i < len; i++ ) {
    elems[i].setAttribute( 'aria-expanded', state );
  }
  if ( cb ) {
    clearTimeout( navTimeOut );
    navTimeOut = setTimeout( function() {
      return cb();
    }, delay );
  }
}
function toggleExpandedState ( elems , state , cb , delay ) { var navTimeout ; if ( elems . constructor !== NodeList && elems . constructor !== Array ) { elems = [ elems ] ; } delay = delay || 300 ; state = state || ! isOneExpanded ( elems ) ; for ( var i = 0 , len = elems . length ; i < len ; i ++ ) { elems [ i ] . setAttribute ( 'aria-expanded' , state ) ; } if ( cb ) { clearTimeout ( navTimeOut ) ; navTimeOut = setTimeout ( function ( ) { return cb ( ) ; } , delay ) ; } }
Change the value of the element's aria-expanded attribute based on it's
 current state if one is not passed.
Change the value of the element ' s aria - expanded attribute based on it ' s current state if one is not passed .