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