PageSourceSearch

https://epernay-agglo.fr/modules/contrib/we_megamenu/assets/js/we_megamenu_frontend.js?v=1

js epernay-agglo.fr collected 2026-10-02 19:10:56 UTC 2,194 bytes, 61 lines download raw bytes

1Drupal.WeMegaMenuFrontEnd = Drupal.WeMegaMenuFrontEnd || {};
2Drupal.WeMegaMenuFrontEnd.mobileThreadHold = 1024;
3Drupal.WeMegaMenuFrontEnd.megamenuActivated = false;
4
5(function ($, Drupal, drupalSettings) {
6  "use strict";
7
8  Drupal.behaviors.kMegaMenuFrontEndAction = {
9    attach: function (context) {
10      $(window).on('load', function () {
11        Drupal.WeMegaMenuFrontEnd.init();
12        Drupal.WeMegaMenuFrontEnd.mobileMenu();
13      })
14    }
15  }
16
17  Drupal.WeMegaMenuFrontEnd.init = function () {
18    if (Drupal.WeMegaMenuFrontEnd.megamenuActivated) {
19      return;
20    }
21    Drupal.WeMegaMenuFrontEnd.megamenuActivated = true;
22    var megamenu = $('nav.navbar-we-mega-menu');
23    if (megamenu.hasClass('click-action')) {
24      megamenu.find('ul li.dropdown-menu > a').click(function () {
25        var li = $(this).closest("li");
26
27        if (li.hasClass("clicked")) {
28          li.closest('ul').find('li').removeClass('clicked');
29          li.closest('.we-mega-menu-row').find('li').removeClass('clicked');
30          li.removeClass("clicked");
31          megamenu.removeClass("has-clicked");
32        } else {
33          li.closest('ul').find('li').removeClass('clicked');
34          li.closest('.we-mega-menu-row').find('li').removeClass('clicked');
35          li.closest("ul").children("li.dropdown-menu").removeClass("clicked");
36          li.addClass("clicked");
37          megamenu.addClass("has-clicked");
38        }
39        if ($(window).outerWidth() > Drupal.WeMegaMenuFrontEnd.mobileThreadHold) {
40          return false;
41        }
42      });
43      megamenu.find('ul li.dropdown-menu > a').dblclick(function () {
44        if ($(window).outerWidth() > Drupal.WeMegaMenuFrontEnd.mobileThreadHold) {
45          window.location.href = $(this).attr("href");
46        }
47      });
48      megamenu.click(function (event) {
49        event.stopPropagation();
50      })
51      $("body").click(function () {
52        megamenu.find("ul li.dropdown-menu.clicked").removeClass('clicked');
53        megamenu.removeClass("has-clicked");
54      });
55    }
56  }
57
58  Drupal.WeMegaMenuFrontEnd.mobileMenu = function () {
59    $('div.region-we-mega-menu .navbar-toggle').mobileMenu();
60  }
61})(jQuery, Drupal, drupalSettings);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.