1 2$(document).ready(function(){ 3 4 $('body').click(function(e){ 5 //console.log(e); 6 /** 7 * Toggle the searchInput when clicking body, but not on this glass/input 8 */ 9 if (['searchInput', 'magnifyingGlass', 'searchResult'].indexOf(e.target.id) < 0) 10 $.fn.hideSearchInput(); 11 12 }); 13 14 15 /** 16 * Navigation sub menus 17 */ 18 $('.nav > li > div > a, .magnifyingGlass').mouseenter(function(){ 19 $('.nav-sub-menu:visible').hide(0); 20 }); 21 22 $('.nav-sub-menu').mouseleave(function(){ 23 $(this).fadeOut(0); 24 var belongsTo = $(this).data('belongs-to'); 25 $('#nav-' + belongsTo).removeClass('active'); 26 }); 27 28 $('.nav-sub-menu').mouseenter(function(){ 29 var belongsTo = $(this).data('belongs-to'); 30 $('#nav-' + belongsTo).addClass('active'); 31 }); 32 33 $('.nav').mouseleave(function(){ 34 $('.nav-sub-menu:visible').hide(0); 35 }); 36 37 $('.has-nav-sub-menu') 38 .mouseenter(function(e){ 39 $('#sub-menu-' + $(this).data('sub-menu')).show(0); 40 }) 41 .click(function(e){ 42 e.preventDefault(); 43 }); 44 45/* 46 $('.nafv-club-logo') 47 .click(function(e){ e.preventDefault(); $('.club-logo-tooltip').fadeIn(200); }) 48 .mouseenter(function(e){ $('.club-logo-tooltip').fadeIn(200); }) 49 .mouseleave(function(e){ $('.club-logo-tooltip').hide(0); }); 50*/ 51 52 53 /** 54 * Handle different keypress actions/events 55 */ 56 $(document).on('keyup', function(e){ 57 var key=e.keyCode || e.which; 58 59 if (key == 27) // Esc 60 $.fn.hideSearchInput(); 61 }); 62 63 /** 64 * Function: Hide search input 65 */ 66 $.fn.hideSearchInput = function(){ 67 $('.nd-nav .searchFieldContainer input:visible').hide(0).val(''); 68 }; 69 70 71 /** 72 * Display search input when clicking on magnifying glass 73 */ 74 $('.nd-nav .magnifyingGlass').click(function(){ 75 $('.nd-nav input:hidden').show(0).focus(); 76 }); 77 78 $('.display-modal').click(function(e){ 79 e.preventDefault(); 80 var modal = $(this).data('modal'); 81 $('#'+modal).fadeIn(400); 82 }); 83 84 85 86 /** 87 * For easy access of color elements added to the SH design. 88 * This class automatically adds an absolute positioned element 89 * over anonther with the purpose of adding a light/dark blue transparent 90 * color. For instance on containers with a background, or images that needs 91 * to be a bit easier for the eye. 92 */ 93 if ($('.has-sh-overlay').length) 94 { 95 $('.has-sh-overlay').each(function(index, el) 96 { 97 $(el).addClass('position-relative'); 98 99 switch ($(el).prop('nodeName').toLowerCase()) 100 { 101 case 'div': 102 103 /** 104 * Add relative position to all kids without positioning. 105 */ 106 $(el).children().each(function(i, child) { 107 if (['static', 'undefined'].indexOf(typeof $(child).css('position')) !== false) 108 $(child).addClass('position-relative'); 109 }); 110 111 /** 112 * Add the sh overlay 113 */ 114 $(el).prepend('<div class="sh-overlay"></div>'); 115 116 break; 117 case 'img': 118 119 /** 120 * Add relative position to all kids without positioning. 121 */ 122 $(el).wrap('<div class="sh-underlay"></div>'); 123 124 break; 125 default: break; 126 } 127 }); 128 } 129 130 131});
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.