On Mobile getting multiple instances

info34's picture
info34
Thu, 06/28/2018 - 16:50
#1
On Mobile getting multiple instances

Hi,

we are getting an error on mobile.

Is making multiple instances of the menu, we are using Drupal 8 and Bootstrap.

https://imgur.com/gvNYeb4

<div class="awemenu-container" >
    <div class="awemenu-bars"><span class="amm-bar"></span></div>
    <div class="awemenu-bars"><span class="amm-bar"></span></div>
    <div class="awemenu-bars"><span class="amm-bar"></span></div>
    <ul class="awemenu">
        ...
    </ul>
</div>

cindy's picture
cindy
Thu, 06/28/2018 - 22:47

Hi,

Please open file megamenu_front.js in folder md_megamenu/assets/js/

And search function fix_megamenu_flashing_on_mobile()

then replace:

$navigation.addClass('awemenu-mobile awemenu-mobile-' + mobileType).removeClass('awemenu-' + type).find('> .awemenu-container').prepend('<div class="awemenu-bars"><span class="amm-bar"></span></div>');

with:

$navigation.addClass('awemenu-mobile awemenu-mobile-' + mobileType).removeClass('awemenu-' + type);
if(!$('.awemenu-bars', $navigation).length)
$navigation.find('> .awemenu-container').prepend('<div class="awemenu-bars"><span class="amm-bar"></span></div>');

info34's picture
info34
Fri, 06/29/2018 - 10:49

ok works perfectly,

now we need 2 things, the first one, there is another way to fix this without hacking the module core? for futures updates.

And the other one, how we disable the mobile behaviour? becouse the "Enable mobile menu" dont do anything.

Thanks

cindy's picture
cindy
Wed, 07/04/2018 - 00:38

Hi,

Please check your email for the update

Log in or register to post comments
Have More Idea?

We are here to build your website!

No Universal solution fits all special business requirements. Our experienced team is ready with ideas and state-of-the-art technical solutions to consult the best solution within your budget.