PageSourceSearch

https://www.ordercatering.com/wp-content/themes/2point-ordercatering-2025/js/mob-menu.js

js ordercatering.com collected 2026-10-01 05:54:37 UTC 2,867 bytes, 77 lines download raw bytes

1
2// MOBILE MENU
3$(document).ready(function() {
4    $('.menu-bar').on('click', function() {
5        $(this).toggleClass('in').parents('body').toggleClass('mobile-menu');
6        $(this).next().toggleClass('in');
7    });
8    $('.mobile-scroll li.menu-item-has-children').on('click', function() {
9        var aftercl = psuedoClick(this);
10        var clickafter = psuedoClick(this).after;
11        if (clickafter == true) {
12            console.log($(aftercl));
13            if (!$(this).hasClass('open')) {
14                $(this).addClass('open');
15                $(this).children('ul').addClass('in');
16            } else {
17                $(this).find('.sub-menu').removeClass('in');
18                $(this).removeClass('open');
19                $(this).find('li.open').removeClass('open');
20            }
21        }
22        $('.sub-menu .sub-menu.in li.open').click(function() {
23            $(this).removeClass('open');
24            $(this).children('.sub-menu.in').removeClass('in');
25        })
26        console.log($(this).children('.sub-menu'));
27    });
28
29    $(document).bind('click', function(e) {
30        var $clicked = $(e.target);
31        if (!$clicked.parents().hasClass('main-nav')) {
32            $('.main-nav').find('.in').removeClass('in');
33            $('body').removeClass('mobile-menu');
34        }
35    });
36});
37function psuedoClick(parentElem) {
38
39    var beforeClicked,
40      afterClicked;
41
42  var parentLeft = parseInt(parentElem.getBoundingClientRect().left, 10),
43      parentTop = parseInt(parentElem.getBoundingClientRect().top, 10);
44
45  var parentWidth = parseInt(window.getComputedStyle(parentElem).width, 10),
46      parentHeight = parseInt(window.getComputedStyle(parentElem).height, 10);
47
48  var before = window.getComputedStyle(parentElem, ':before');
49
50  var beforeStart = parentLeft + (parseInt(before.getPropertyValue("left"), 10)),
51      beforeEnd = beforeStart + parseInt(before.width, 10);
52
53  var beforeYStart = parentTop + (parseInt(before.getPropertyValue("top"), 10)),
54      beforeYEnd = beforeYStart + parseInt(before.height, 10);
55
56  var after = window.getComputedStyle(parentElem, ':after');
57
58  var afterStart = parentLeft + (parseInt(after.getPropertyValue("left"), 10)),
59      afterEnd = afterStart + parseInt(after.width, 10);
60
61  var afterYStart = parentTop + (parseInt(after.getPropertyValue("top"), 10)),
62      afterYEnd = afterYStart + parseInt(after.height, 10);
63
64  var mouseX = event.clientX,
65      mouseY = event.clientY;
66
67  beforeClicked = (mouseX >= beforeStart && mouseX <= beforeEnd && mouseY >= beforeYStart && mouseY <= beforeYEnd ? true : false);
68
69  afterClicked = (mouseX >= afterStart && mouseX <= afterEnd && mouseY >= afterYStart && mouseY <= afterYEnd ? true : false);
70
71  return {
72    "before" : beforeClicked,
73    "after"  : afterClicked
74
75  };
76
77}

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.