function resume() {
      if ( _suspended ) {
        var level2 = _menus.getAllAtLevel( 1 );
        var menu;
        var contentDom;
        var wrapperDom;
        var wrapperSel = '.o-mega-menu_content-2-wrapper';
        var transition;
        for ( var i = 0, len = level2.length; i < len; i++ ) {
          menu = level2[i].data;
          contentDom = menu.getDom().content;
          wrapperDom = contentDom.querySelector( wrapperSel );
          transition = menu.getTransition();
          // This checks if the transition has been removed by MegaMenuMobile.
          if ( transition ) {
            transition.setElement( wrapperDom );
          } else {
            transition = new MoveTransition( wrapperDom );
          }
          transition.moveUp();
          // TODO: The only reason hiding is necessary is that the
          //       drop-shadow of the menu extends below it border,
          //       so it's still visible when the menu slides -100% out of view.
          //       Investigate whether it would be better to have a u-move-up-1_1x
          //       or similar class to move up -110%. Or whether the drop-shadow
          //       could be included within the bounds of the menu.
          menu.getDom().content.classList.add( 'u-invisible' );
          menu.setExpandTransition( transition, transition.moveToOrigin );
          menu.setCollapseTransition( transition, transition.moveUp );

          // 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 ( menu.isExpanded() ) {
            menu.collapse();
          }
        }

        // TODO: Combine this loop with the above
        //       into a Breadth-First Search iteration.
        var level3 = _menus.getAllAtLevel( 2 );
        for ( var i2 = 0, len2 = level3.length; i2 < len2; i2++ ) {
          level3[i2].data.suspend();
        }

        _suspended = false;
      }

      return !_suspended;
    }
/**
     * Add events necessary for the desktop menu behaviors.
     * @returns {boolean} Whether it has successfully been resumed or not.
     */
Add events necessary for the desktop menu behaviors.
@returns {boolean} Whether it has successfully been resumed or not.
Add events necessary for the desktop menu behaviors . @returns { boolean } Whether it has successfully been resumed or not .
function resume() {
      if ( _suspended ) {
        var level2 = _menus.getAllAtLevel( 1 );
        var menu;
        var contentDom;
        var wrapperDom;
        var wrapperSel = '.o-mega-menu_content-2-wrapper';
        var transition;
        for ( var i = 0, len = level2.length; i < len; i++ ) {
          menu = level2[i].data;
          contentDom = menu.getDom().content;
          wrapperDom = contentDom.querySelector( wrapperSel );
          transition = menu.getTransition();
          if ( transition ) {
            transition.setElement( wrapperDom );
          } else {
            transition = new MoveTransition( wrapperDom );
          }
          transition.moveUp();
          menu.getDom().content.classList.add( 'u-invisible' );
          menu.setExpandTransition( transition, transition.moveToOrigin );
          menu.setCollapseTransition( transition, transition.moveUp );
          if ( menu.isExpanded() ) {
            menu.collapse();
          }
        }
        var level3 = _menus.getAllAtLevel( 2 );
        for ( var i2 = 0, len2 = level3.length; i2 < len2; i2++ ) {
          level3[i2].data.suspend();
        }
        _suspended = false;
      }
      return !_suspended;
    }
function resume ( ) { if ( _suspended ) { var level2 = _menus . getAllAtLevel ( 1 ) ; var menu ; var contentDom ; var wrapperDom ; var wrapperSel = '.o-mega-menu_content-2-wrapper' ; var transition ; for ( var i = 0 , len = level2 . length ; i < len ; i ++ ) { menu = level2 [ i ] . data ; contentDom = menu . getDom ( ) . content ; wrapperDom = contentDom . querySelector ( wrapperSel ) ; transition = menu . getTransition ( ) ; if ( transition ) { transition . setElement ( wrapperDom ) ; } else { transition = new MoveTransition ( wrapperDom ) ; } transition . moveUp ( ) ; menu . getDom ( ) . content . classList . add ( 'u-invisible' ) ; menu . setExpandTransition ( transition , transition . moveToOrigin ) ; menu . setCollapseTransition ( transition , transition . moveUp ) ; if ( menu . isExpanded ( ) ) { menu . collapse ( ) ; } } var level3 = _menus . getAllAtLevel ( 2 ) ; for ( var i2 = 0 , len2 = level3 . length ; i2 < len2 ; i2 ++ ) { level3 [ i2 ] . data . suspend ( ) ; } _suspended = false ; } return ! _suspended ; }
Add events necessary for the desktop menu behaviors.
Add events necessary for the desktop menu behaviors .
// This checks if the transition has been removed by MegaMenuMobile. // TODO: The only reason hiding is necessary is that the //       drop-shadow of the menu extends below it border, //       so it's still visible when the menu slides -100% out of view. //       Investigate whether it would be better to have a u-move-up-1_1x //       or similar class to move up -110%. Or whether the drop-shadow //       could be included within the bounds of the menu. // 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: Combine this loop with the above //       into a Breadth-First Search iteration.