function _updateMenuState( menu, type ) {
    if ( menu === null || _activeMenu === menu ) {
      // A menu is closed.
      window.clearTimeout( _showDelay );
      _activeMenu.getTransition().animateOn();
      _activeMenu.collapse();
      _activeMenu = null;
      _bodyDom.removeEventListener( 'mousemove', _handleMove );
      _bodyDom.removeEventListener( 'mouseleave', _handleMove );
    } else if ( _activeMenu === null ) {
      // A menu is opened.
      _activeMenu = menu;
      _activeMenu.getTransition().animateOn();
      // Mousemove needed in addition to mouseout of the trigger
      // in order to check if user has moved off the menu <ul> and not
      // just the <li> list items.
      _bodyDom.addEventListener( 'mousemove', _handleMove );
      _bodyDom.addEventListener( 'mouseleave', _handleMove );
      _activeMenu.expand();
    } else {
      // An open menu has switched to another menu.
      _activeMenu.getTransition().animateOff();
      _activeMenu.collapse();
      _activeMenu = menu;
      if ( type === 'triggerOver' ) {
        _activeMenu.getTransition().animateOff();
        _activeMenu.expand();
      }
    }
  }
/**
   * Cleanup state and set the currently active menu.
   * @param {FlyoutMenu} menu - The menu currently being activated.
   * @param {string} type - The event type that is calling this method.
   */
Cleanup state and set the currently active menu.
@param {FlyoutMenu} menu - The menu currently being activated.
@param {string} type - The event type that is calling this method.
Cleanup state and set the currently active menu . @param { FlyoutMenu } menu - The menu currently being activated . @param { string } type - The event type that is calling this method .
function _updateMenuState( menu, type ) {
    if ( menu === null || _activeMenu === menu ) {
      window.clearTimeout( _showDelay );
      _activeMenu.getTransition().animateOn();
      _activeMenu.collapse();
      _activeMenu = null;
      _bodyDom.removeEventListener( 'mousemove', _handleMove );
      _bodyDom.removeEventListener( 'mouseleave', _handleMove );
    } else if ( _activeMenu === null ) {
      _activeMenu = menu;
      _activeMenu.getTransition().animateOn();
      _bodyDom.addEventListener( 'mousemove', _handleMove );
      _bodyDom.addEventListener( 'mouseleave', _handleMove );
      _activeMenu.expand();
    } else {
      _activeMenu.getTransition().animateOff();
      _activeMenu.collapse();
      _activeMenu = menu;
      if ( type === 'triggerOver' ) {
        _activeMenu.getTransition().animateOff();
        _activeMenu.expand();
      }
    }
  }
function _updateMenuState ( menu , type ) { if ( menu === null || _activeMenu === menu ) { window . clearTimeout ( _showDelay ) ; _activeMenu . getTransition ( ) . animateOn ( ) ; _activeMenu . collapse ( ) ; _activeMenu = null ; _bodyDom . removeEventListener ( 'mousemove' , _handleMove ) ; _bodyDom . removeEventListener ( 'mouseleave' , _handleMove ) ; } else if ( _activeMenu === null ) { _activeMenu = menu ; _activeMenu . getTransition ( ) . animateOn ( ) ; _bodyDom . addEventListener ( 'mousemove' , _handleMove ) ; _bodyDom . addEventListener ( 'mouseleave' , _handleMove ) ; _activeMenu . expand ( ) ; } else { _activeMenu . getTransition ( ) . animateOff ( ) ; _activeMenu . collapse ( ) ; _activeMenu = menu ; if ( type === 'triggerOver' ) { _activeMenu . getTransition ( ) . animateOff ( ) ; _activeMenu . expand ( ) ; } } }
Cleanup state and set the currently active menu.
Cleanup state and set the currently active menu .
// A menu is closed. // A menu is opened. // Mousemove needed in addition to mouseout of the trigger // in order to check if user has moved off the menu <ul> and not // just the <li> list items. // An open menu has switched to another menu.