1function ScrollSharedFunctions() { 2 this.checkScrollDistance = function() { 3 return $(document).scrollTop() > 0 || $('html,body').scrollTop() > 0; 4 }; 5 6 this.setScrollClass = function() { 7 if (!$(document.body).hasClass('disabledScroll')) { 8 if (this.checkScrollDistance()) { 9 $('.navigationDCE').addClass('scroll'); 10 $('.navigationDCE').removeClass('notScroll'); 11 } else { 12 $('.navigationDCE').removeClass('scroll'); 13 $('.navigationDCE').addClass('notScroll'); 14 } 15 } 16 }; 17} 18 19function DefaultScroll() { 20 this.isScrollJacking = false; 21 this.scrollSharedFunctions = null; 22 23 this.scrollCallbacks = []; 24 25 this.init = function() { 26 let scrollObj = this; 27 28 scrollObj.scrollSharedFunctions = new ScrollSharedFunctions(); 29 30 let scrolled = false; 31 document.addEventListener('scroll', function(event) { 32 scrolled = true; 33 }, { 34 capture: true, 35 passive: true 36 }); 37 38 function onScroll() { 39 if (scrolled) { 40 scrollObj.scrollCallbacks.forEach(function(element) { 41 element($(document).scrollTop()); 42 }); 43 scrollObj.scrollSharedFunctions.setScrollClass(); 44 scrolled = false; 45 } 46 47 requestAnimationFrame(onScroll); 48 } 49 50 requestAnimationFrame(onScroll); 51 52 scrollObj.scrollSharedFunctions.setScrollClass(); 53 } 54 55 this.scrollTo = function(targetPosY) { 56 $('html, body').animate({ scrollTop: targetPosY }, 800); 57 } 58 59 this.setScrollPosY = function(targetPosY) { 60 $('html, body').animate({ scrollTop: targetPosY }, 0); 61 } 62 63 this.init(); 64}
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.