Compatibility with Bootstrap

Michael Tietz's picture
Michael Tietz
Mon, 02/27/2017 - 12:15
#1
Compatibility with Bootstrap

Hi, just purchased the Megamenu module and It seems, it's not working well with Bootstrap, maybe a conflict on jQuery-requirements? Things like Drag'n'Drop are not working. In the console I get an error about the loaded jQuery version, but only on the edit pages for megamenu:

Uncaught Error: Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3

Jquery-updte loads version 1.10, but gets lost, because megamenu loads its own jquery version 1.4.4.

A quick n dirty try to swap the included jquery.js and jquery-ui.min.js produced other warnings in console:

Uncaught TypeError: Cannot read property 'msie' of undefined
    at jquery.cleditor.js?om1ly0:156
    at jquery.cleditor.js?om1ly0:1149
(anonymous) @ jquery.cleditor.js?om1ly0:156
(anonymous) @ jquery.cleditor.js?om1ly0:1149
md.tree-menu.js?om1ly0:62 Uncaught TypeError: $(...).live is not a function
    at HTMLDocument.<anonymous> (md.tree-menu.js?om1ly0:62)
    at c (jquery.js?v=1.4.4:4)
    at Object.fireWith [as resolveWith] (jquery.js?v=1.4.4:4)
    at Function.ready (jquery.js?v=1.4.4:4)
    at HTMLDocument.q (jquery.js?v=1.4.4:4)

I looked through the module code and found this in the md_megamodule.module, line 504:

$libraries['jquery']['version'] = '1.4.4';

Can this somehow be fixed? I think, Megamenu is ignoring jQuery-Update and Bootstrap. My temporary fix is to leave the admin pages on the default Bartk theme.

phuonght's picture
phuonght
Mon, 03/06/2017 - 23:52

Hi,

Check your email please.

Thank you.

kconig1's picture
kconig1
Wed, 04/11/2018 - 14:58

Hi, we are having the same issue with Bootstrap as our theme and we have created a subtheme with the Bootstrap Starter Kit. Is there a solution for this? Thank you.

cindy's picture
cindy
Wed, 04/11/2018 - 22:22

Hi,

This problem was fix already. Please go to admin/structure/md-megamenu/common-settings and uncheck "Use jquery 1.7.2 and jquery ui 1.8.7 available in megamenu module." , then megamenu will use jquery set by module jquery update, for example jquery 1.10

http://prntscr.com/j438ee

kconig1's picture
kconig1
Thu, 04/12/2018 - 10:14

We are in  Drupal 8, there is not a md-megamenu in admin/structure. Where else can this be changed? Thank you.

cindy's picture
cindy
Fri, 04/13/2018 - 00:40

Hi,

With Megamenu ver 8, it uses the default jquery in Drupal core. The latest version of Drupal 8 core uses jquery ver 3.x. Which version of jQuery is being used in your site? You can send us your site url and admin account to check. This problem may not come from our module 

info34's picture
info34
Tue, 06/26/2018 - 17:25

Hi, same issue. Drupal 8 and bootstrap 4.

is generating 2 or more instances of the menu.

We also want to disable mobile behavior.

Thanks

cindy's picture
cindy
Thu, 06/28/2018 - 22:49
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.