1(function ($) { 2 'use strict'; 3 Drupal.behaviors.menuSticky = { 4 attach: function (context, settings) { 5 // Hide Header on on scroll down 6 let didScroll; 7 let lastScrollTop = 0; 8 let delta = 5; 9 const navbarHeight = $('header').outerHeight(); 10 let offsetSticky = navbarHeight + 10; 11 12 $(window).scroll(function (event) { 13 didScroll = true; 14 }); 15 16 setInterval(function () { 17 if (didScroll) { 18 hasScrolled(); 19 didScroll = false; 20 } 21 }, 250); 22 23 function hasScrolled() { 24 let st = $(window).scrollTop(); 25 26 // Make sure they scroll more than delta 27 if (Math.abs(lastScrollTop - st) <= delta) 28 return; 29 30 // If they scrolled down and are past the navbar, add class .stuck. 31 // This is necessary so you never see what is "behind" the navbar. 32 if (st > lastScrollTop && st > navbarHeight) { 33 // Scroll Down 34 $('.gv-sticky-menu').removeClass('stuck'); 35 } else { 36 // Scroll Up 37 if (st + $(window).height() < $(document).height()) { 38 $('.gv-sticky-menu').addClass('stuck'); 39 } 40 41 if (st <= offsetSticky) { 42 $('.gv-sticky-menu').removeClass('stuck'); 43 } 44 } 45 46 lastScrollTop = st; 47 } 48 49 } 50 } 51})(jQuery);
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.