diff --git a/templates/menu_tree/menu_tree.js b/templates/menu_tree/menu_tree.js index cb101ef8..c477537d 100644 --- a/templates/menu_tree/menu_tree.js +++ b/templates/menu_tree/menu_tree.js @@ -4,16 +4,20 @@ */ (function ($) { - Drupal.behaviors.ecEuropaMenuTree = { - attach: function (context) { - $('.ecl-navigation-menu__root').once('ecEuropaMenuTree', function() { - ECL.megamenu('.ecl-navigation-menu__root'); - }); - } - }; Drupal.behaviors.megaMenu = { attach: function (context, settings) { ECL.megamenu(); + + // Fix burger menu. + $('.ecl-navigation-menu__hamburger').click(function() { + var button = $(this); + + if (button.attr('aria-expanded') == 'true') { + button.attr('aria-expanded', 'false'); + } else { + button.attr('aria-expanded', 'true'); + } + }); } }; })(jQuery);