PageSourceSearch

https://www.timjbradley.com/files/theme/custom.js?1643661899

js timjbradley.com collected 2026-09-30 20:24:28 UTC 2,821 bytes, 113 lines download raw bytes

1jQuery(function($) {
2
3    // Hamburger menu toggle
4
5    $('.hamburger').click(function(){
6      $('body').toggleClass("menu-open");
7    });
8
9    // Add fullwidth class to gallery thumbs if less than 6
10
11    $('.imageGallery').each(function(){
12      if ($(this).children('div').length <= 6) {
13        $(this).children('div').addClass('fullwidth-mobile');
14      }
15    });
16
17    // Cart mobile
18
19    function cartdisplay() {
20      if (Number($('#wsite-nav-cart-num').text()) > 0 ) {
21        $('#wsite-mini-cart').addClass('full');
22        $('#footer-wrap').addClass('footer-full');
23      }
24      else {
25        $('#wsite-mini-cart').removeClass('full');
26        $('#footer-wrap').removeClass('footer-full');
27      }
28    }
29
30    setTimeout(function() { cartdisplay(); }, 1000);
31
32    $('.wsite-product-button, #wsite-com-product-add-to-cart, .wsite-product-item .wsite-remove-button').on('click', function(){
33      setTimeout(function() { cartdisplay(); }, 800);
34    });
35
36
37  // Swipe gallery function
38
39  var swipeGallery = function(){
40    setTimeout(function(){
41      var touchGallery = document.getElementsByClassName('fancybox-wrap')[0];
42      var mc = new Hammer(touchGallery);
43      mc.on("panleft panright", function(ev) {
44        if (ev.type == "panleft") {
45          $("a.fancybox-next").trigger("click");
46        } else if (ev.type == "panright") {
47          $("a.fancybox-prev").trigger("click");
48        }
49        swipeGallery();
50      });
51    }, 500);
52}
53
54  setTimeout(function() {
55    var login = $("#member-login").clone(true);
56    login.appendTo("#navmobile .wsite-menu-default");
57  }, 500);
58
59  // Initiate Swipe function on touch devices
60
61  if ('ontouchstart' in window) {
62    $("body").addClass("touch");
63    $("body").on( "click", "a.w-fancybox", function() {
64      swipeGallery();
65    });
66  }
67
68  // Sticky Nav
69
70  var navCheck = function() {
71    if ($("body").width() > 1024) {
72      $('body:not(.wsite-native-mobile-editor, .wsite-checkout-page) #nav').waypoint('sticky');
73    }
74    else {
75      setTimeout(function(){ $('body:not(.wsite-native-mobile-editor, .wsite-checkout-page) #header-wrap').waypoint('sticky'); }, 500);
76    }
77  }
78
79  navCheck();
80
81  var timeout;
82
83  $(window).on('resize', function(e) {
84
85    clearTimeout(timeout);
86    timeout = setTimeout(function() {
87
88      $('.stuck').waypoint('unsticky');
89
90      navCheck();
91
92    }, 300);
93
94  });
95
96
97
98  // Storefront category list mobile menu
99  var sidebar = $('.wsite-com-sidebar'),
100      categories =  $("#wsite-com-hierarchy");
101
102  sidebar.click(function(){
103    sidebar.hasClass('sidebar-expanded') ? null : sidebar.addClass('sidebar-expanded');
104  });
105
106  categories.prepend('<a id="close" href="#">CLOSE</a>');
107  $('#close').click(function(e){
108    e.preventDefault();
109    setTimeout(function() {sidebar.removeClass('sidebar-expanded');}, 50);
110  });
111
112
113});

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.