1/* */ 2 3var hudsonvalley = { 4 5 init: function(){ 6 7 // Sticky nav scroll follow 8 window.onscroll = function(){ 9 hudsonvalley.nav.sticky(); 10 }; 11 hudsonvalley.nav.sticky(); 12 13 // Tray nav hide 14 $(document).click(function(event) { 15 if( 16 $('.nav-tray').is(':visible') 17 && $(event.target).closest('nav.main').length <= 0 18 ){ 19 $('.nav-tray').hide(); 20 $('nav.main .main-bar a').removeClass('active'); 21 hudsonvalley.currentNav = null; 22 } 23 }); 24 25 }, 26 27 nav: { 28 29 sticky: function() 30 { 31 var threshold = $( window ).width() >= 480 ? 265 : 135 ; 32 if( window.scrollY > threshold ){ 33 $('body').addClass('stickyNav'); 34 $('.stickyNav').find('.main-bar').removeClass('container'); 35 }else{ 36 $('body').removeClass('stickyNav'); 37 $('.main-bar').addClass('container'); 38 } 39 }, 40 41 click: function(linkEl) 42 { 43 var threshold = $( window ).width() >= 480 ? 265 : 135 ; 44 var id = linkEl.data('id'); 45 var asset = JSON.parse(atob(linkEl.data('asset'))); 46 var position = linkEl.position(); 47 if( window.scrollY > threshold ){ 48 var new_top = window.scrollY+40; 49 }else{ 50 var new_top = position.top+40; 51 } 52 var left = position.left; 53 var new_offset = { top: new_top, left: left }; 54 console.log(position); 55 console.log(new_offset); 56 $('nav.main .main-bar a').removeClass('active'); 57 if( 58 typeof asset.children == 'object' 59 && asset.children.length > 0 60 ){ 61 $('.nav-tray').toggleClass('active'); 62 $('.nav-tray.active').offset(new_offset); 63 $('.nav-tray-item').hide(); 64 if( hudsonvalley.currentNav == id ){ 65 hudsonvalley.currentNav = null; 66 }else{ 67 $('.nav-tray-item[data-id='+id+']').show(); 68 $('.nav-tray').slideDown(100); 69 hudsonvalley.currentNav = id; 70 linkEl.addClass('active'); 71 } 72 }else{ 73 if( asset.category_link.indexOf('http') == 0 ){ 74 window.open(asset.category_link); 75 }else{ 76 window.location.href = asset.category_link; 77 } 78 } 79 } 80 81 } 82 83}; 84 85$(function(){ 86 hudsonvalley.init(); 87});
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.