function suspend() {
      if ( !_suspended ) {
        _suspended = true;

        _rootMenu.getTransition().remove();

        var rootNode = _menus.getRoot();
        treeTraversal.bfs( rootNode, function( node ) {
          node.data.setCollapseTransition( null );
          node.data.setExpandTransition( null );

          // TODO: Investigate whether deferred collapse has another solution.
          //       This check is necessary since a call to an already collapsed
          //       menu will set a deferred collapse that will be called
          //       on expandEnd next time the flyout is expanded.
          //       The deferred collapse is used in cases where the
          //       user clicks the flyout menu while it is animating open,
          //       so that it appears like they can collapse it, even when
          //       clicking during the expand animation.
          if ( node.data.isExpanded() ) {
            node.data.collapse();
          }
        } );

        _rootMenuContentDom.classList.remove( 'u-invisible' );
        _rootMenuContentDom.classList.remove( 'u-hidden-overflow' );

        // TODO: Investigate updating this to close the menus directly
        //       so `_handleCollapseEnd` is fired.
        this.dispatchEvent( 'rootCollapseEnd', { target: this } );
        _bodyDom.removeEventListener( 'mousedown', _handleBodyClick );
      }

      return _suspended;
    }
/**
     * Remove events necessary for the desktop menu behaviors.
     * @returns {boolean} Whether it has successfully been suspended or not.
     */
Remove events necessary for the desktop menu behaviors.
@returns {boolean} Whether it has successfully been suspended or not.
Remove events necessary for the desktop menu behaviors . @returns { boolean } Whether it has successfully been suspended or not .
function suspend() {
      if ( !_suspended ) {
        _suspended = true;
        _rootMenu.getTransition().remove();
        var rootNode = _menus.getRoot();
        treeTraversal.bfs( rootNode, function( node ) {
          node.data.setCollapseTransition( null );
          node.data.setExpandTransition( null );
          if ( node.data.isExpanded() ) {
            node.data.collapse();
          }
        } );
        _rootMenuContentDom.classList.remove( 'u-invisible' );
        _rootMenuContentDom.classList.remove( 'u-hidden-overflow' );
        this.dispatchEvent( 'rootCollapseEnd', { target: this } );
        _bodyDom.removeEventListener( 'mousedown', _handleBodyClick );
      }
      return _suspended;
    }
function suspend ( ) { if ( ! _suspended ) { _suspended = true ; _rootMenu . getTransition ( ) . remove ( ) ; var rootNode = _menus . getRoot ( ) ; treeTraversal . bfs ( rootNode , function ( node ) { node . data . setCollapseTransition ( null ) ; node . data . setExpandTransition ( null ) ; if ( node . data . isExpanded ( ) ) { node . data . collapse ( ) ; } } ) ; _rootMenuContentDom . classList . remove ( 'u-invisible' ) ; _rootMenuContentDom . classList . remove ( 'u-hidden-overflow' ) ; this . dispatchEvent ( 'rootCollapseEnd' , { target : this } ) ; _bodyDom . removeEventListener ( 'mousedown' , _handleBodyClick ) ; } return _suspended ; }
Remove events necessary for the desktop menu behaviors.
Remove events necessary for the desktop menu behaviors .
// TODO: Investigate whether deferred collapse has another solution. //       This check is necessary since a call to an already collapsed //       menu will set a deferred collapse that will be called //       on expandEnd next time the flyout is expanded. //       The deferred collapse is used in cases where the //       user clicks the flyout menu while it is animating open, //       so that it appears like they can collapse it, even when //       clicking during the expand animation. // TODO: Investigate updating this to close the menus directly //       so `_handleCollapseEnd` is fired.