function _handleTriggerClick( event ) {
    this.dispatchEvent( 'triggerClick', { target: this } );
    var menu = event.target;
    var rootMenu = _menus.getRoot().data;
    var menuNode = menu.getData();
    var level = menuNode.level;
    var transition = rootMenu.getTransition();

    // Halt any active transitions.
    if ( _activeMenu ) {
      _activeMenu.getTransition().halt();
    }

    if ( menu === rootMenu ) {
      // Root menu clicked.

      // Root menu is closing.
      if ( menu.isExpanded() ) {
        level = _activeMenu.getData().level;
        menu.setCollapseTransition( transition,
                                    transition.moveLeft, [ level + 1 ] );
      }
    } else {
      // Submenu clicked.
      var siblings = _menus.getAllAtLevel( level );
      var siblingMenu;
      for ( var i = 0, len = siblings.length; i < len; i++ ) {
        siblingMenu = siblings[i].data;
        siblingMenu
          .setExpandTransition( transition, transition.moveLeft, [ level ] );
        // If on the 2nd level menu, set the back button to moveToOrigin,
        // otherwise we're on the 3rd level menu, so moveLeft is needed.
        if ( level === 1 ) {
          siblingMenu
            .setCollapseTransition( transition, transition.moveToOrigin );
        } else {
          siblingMenu.setCollapseTransition( transition, transition.moveLeft );
        }
        // If we're on the current menu, show it & hide all the other siblings.
        if ( siblings[i] === menuNode ) {
          siblingMenu.getDom().content.classList.remove( 'u-invisible' );
        } else {
          siblingMenu.getDom().content.classList.add( 'u-invisible' );
        }
      }

      // TODO: Investigate helper functions to mask these crazy long lookups!
      menuNode.parent.data.getDom()
        .content.classList.remove( 'u-hidden-overflow' );
    }
    _activeMenu = menu;
  }
/**
   * Event handler for when FlyoutMenu trigger is clicked.
   * @param {Event} event - A FlyoutMenu event.
   */
Event handler for when FlyoutMenu trigger is clicked.
@param {Event} event - A FlyoutMenu event.
Event handler for when FlyoutMenu trigger is clicked . @param { Event } event - A FlyoutMenu event .
function _handleTriggerClick( event ) {
    this.dispatchEvent( 'triggerClick', { target: this } );
    var menu = event.target;
    var rootMenu = _menus.getRoot().data;
    var menuNode = menu.getData();
    var level = menuNode.level;
    var transition = rootMenu.getTransition();
    if ( _activeMenu ) {
      _activeMenu.getTransition().halt();
    }
    if ( menu === rootMenu ) {
      if ( menu.isExpanded() ) {
        level = _activeMenu.getData().level;
        menu.setCollapseTransition( transition,
                                    transition.moveLeft, [ level + 1 ] );
      }
    } else {
      var siblings = _menus.getAllAtLevel( level );
      var siblingMenu;
      for ( var i = 0, len = siblings.length; i < len; i++ ) {
        siblingMenu = siblings[i].data;
        siblingMenu
          .setExpandTransition( transition, transition.moveLeft, [ level ] );
        if ( level === 1 ) {
          siblingMenu
            .setCollapseTransition( transition, transition.moveToOrigin );
        } else {
          siblingMenu.setCollapseTransition( transition, transition.moveLeft );
        }
        if ( siblings[i] === menuNode ) {
          siblingMenu.getDom().content.classList.remove( 'u-invisible' );
        } else {
          siblingMenu.getDom().content.classList.add( 'u-invisible' );
        }
      }
      menuNode.parent.data.getDom()
        .content.classList.remove( 'u-hidden-overflow' );
    }
    _activeMenu = menu;
  }
function _handleTriggerClick ( event ) { this . dispatchEvent ( 'triggerClick' , { target : this } ) ; var menu = event . target ; var rootMenu = _menus . getRoot ( ) . data ; var menuNode = menu . getData ( ) ; var level = menuNode . level ; var transition = rootMenu . getTransition ( ) ; if ( _activeMenu ) { _activeMenu . getTransition ( ) . halt ( ) ; } if ( menu === rootMenu ) { if ( menu . isExpanded ( ) ) { level = _activeMenu . getData ( ) . level ; menu . setCollapseTransition ( transition , transition . moveLeft , [ level + 1 ] ) ; } } else { var siblings = _menus . getAllAtLevel ( level ) ; var siblingMenu ; for ( var i = 0 , len = siblings . length ; i < len ; i ++ ) { siblingMenu = siblings [ i ] . data ; siblingMenu . setExpandTransition ( transition , transition . moveLeft , [ level ] ) ; if ( level === 1 ) { siblingMenu . setCollapseTransition ( transition , transition . moveToOrigin ) ; } else { siblingMenu . setCollapseTransition ( transition , transition . moveLeft ) ; } if ( siblings [ i ] === menuNode ) { siblingMenu . getDom ( ) . content . classList . remove ( 'u-invisible' ) ; } else { siblingMenu . getDom ( ) . content . classList . add ( 'u-invisible' ) ; } } menuNode . parent . data . getDom ( ) . content . classList . remove ( 'u-hidden-overflow' ) ; } _activeMenu = menu ; }
Event handler for when FlyoutMenu trigger is clicked.
Event handler for when FlyoutMenu trigger is clicked .
// Halt any active transitions. // Root menu clicked. // Root menu is closing. // Submenu clicked. // If on the 2nd level menu, set the back button to moveToOrigin, // otherwise we're on the 3rd level menu, so moveLeft is needed. // If we're on the current menu, show it & hide all the other siblings. // TODO: Investigate helper functions to mask these crazy long lookups!