• Resolved mjloeff

    (@mjloeff)


    Will MMM integrate with Beaver Builder Child Theme? We seem to be encountering a problem with the mobile menu of MMM and Beaver. The mobile menu shows, but as soon as you click on it (including sub-menus), the menu closes. I’ve traced this to what appears to be a caused by BB theme.min.js (code excerpt below).
    closeMenu() is firing when there’s a click in the body, menuType gets set to ‘dropdown’, and it follows the pageNav.find( ‘.navbar-toggle’ ).trigger( ‘click’ ) path. The menu closes and the sub menu never gets shown.
    Anyone encounter this and have a good BB and MMM fix?
    Thanks!

    /**
    		 * Closes Dropdown or Flyout Menu when clicked anywhere on the page.
    		 *
    		 * @since 1.7.9
    		 * @param {Object} e
    		 */
    		closeMenu: function (e) {
    			var menuType = $( 'body' ).hasClass( 'fl-nav-mobile-offcanvas' ) ? 'flyout' : 'dropdown',
    				isDropdownMenuActive = $( '.fl-page-nav-collapse' ).hasClass( 'in' ),
    				isFlyoutMenuActive = $( '.fl-page' ).hasClass( 'fl-nav-offcanvas-active' ),
    				pageNav;
    
    			if ( undefined === e || undefined === e.target ) {
    				return;
    			}
    
    			if ( 'dropdown' === menuType && isDropdownMenuActive ) {
    				pageNav = $( '.navbar-collapse.in' ).closest( '.fl-page-nav' );
    				pageNav.find( '.navbar-toggle' ).trigger( 'click' );
    			} else if ( 'flyout' === menuType && isFlyoutMenuActive) {
    				$( '.fl-offcanvas-close' ).trigger( 'click' );
    			}
    		},
    • This topic was modified 4 years, 11 months ago by mjloeff.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author megamenu

    (@megamenu)

    Hi mjloeff,

    I think I remember seeing someone report this a few weeks ago, if I remember correctly it was introduced into the latest beaver builder update.

    Looking at the code, I can’t see an easy way to prevent it from being executed (sometimes you can remove a class from the page). Could you ask beaver builder support if there is a way to prevent the mobile menu from auto closing? It should work even with MMM enabled.

    Regards,
    Tom

    Thread Starter mjloeff

    (@mjloeff)

    Thanks @megamenu – I’ll follow-up with BB.
    In the meantime, I’m doing something like this – not perfect, but it’s an acceptable solution for us at the moment – essentially just unbinding the event when the user clicks on the navbar button.

    
    jQuery(document).ready(function() {
        jQuery('button.navbar-toggle').on('click', function () {
            jQuery('body').unbind('click');
        });
    });
    • This reply was modified 4 years, 11 months ago by mjloeff.
    Plugin Author megamenu

    (@megamenu)

    Hi mjloeff,

    That’s a nice solution, thanks for posting it here!

    Regards,
    Tom

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Beaver Builder’ is closed to new replies.