PageSourceSearch

https://www.kartbus.org/wp-content/themes/kartbus/js/navigation.js?ver=1.0.1

js kartbus.org collected 2026-10-02 06:23:52 UTC 1,254 bytes, 51 lines download raw bytes

1/**
2 * File navigation.js.
3 *
4 * Handles toggling the navigation menu for small screens and enables TAB key
5 * navigation support for dropdown menus.
6 */
7
8 function isMobile() {
9  // return jQuery(window).width() < 768;
10  const mq = window.matchMedia( "(min-width: 768px)" );
11  return !mq.matches;
12}
13
14jQuery(function($) {
15  $('.mobile-menu-controls .hamburger').click(function() {
16    $('#site-navigation').slideDown();
17    $('.mobile-menu-controls .hamburger').hide();
18    $('.mobile-menu-controls .cross').show();
19  });
20
21  $('.mobile-menu-controls .cross').click(function() {
22    $('#site-navigation').slideUp();
23    $('.mobile-menu-controls .hamburger').show();
24    $('.mobile-menu-controls .cross').hide();
25    closeSubMenus();
26  });
27
28  function toggleSubMenu(subMenu) {
29    if (subMenu.is(':visible')) {
30      subMenu.slideUp('fast');
31    } else {
32      subMenu.slideDown('fast');
33    }
34  }
35
36  function closeSubMenus() {
37    $('.sub-menu').slideUp('fast');
38  }
39
40  $('#primary-menu li a').click(function(e) {
41
42    if ($(e.currentTarget).data('name') === 'routes') {
43      e.preventDefault();
44      var subMenu = $('.sub-menu-' + (isMobile() ? 'mobile' : 'desktop'));
45
46      toggleSubMenu(subMenu);
47    } else {
48      closeSubMenus();
49    }
50  });
51});

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.