1/*mobile JS*/ 2 3/*================== 4 Global variable decl. 5===================*/ 6 7var mobW = 800; 8var win = jQuery(window); 9var winW = jQuery(window).width(); 10 11/*================== 12 Document ready 13===================*/ 14 15jQuery(document).ready(function () { 16 mobileToggle(); 17 mobileMenu(); 18 clearSearch(); 19 20 if (winW > 721) { 21 toggleSearchClearBtn(); 22 } 23}); 24 25/*================== 26 Window resize 27===================*/ 28 29jQuery(window).resize(function () { 30 mobileToggle(); 31}); 32 33function toggleSearchClearBtn() { 34 jQuery('#mod-search-searchword90').on('input', function () { 35 if (this.value.replace(/\s/g, '') === '') { 36 jQuery('#form-clear-btn').hide(); 37 } else { 38 jQuery('#form-clear-btn').show(); 39 } 40 }); 41} 42 43/*================== 44 Function decl. 45===================*/ 46 47function mobileToggle() { 48 var menu = jQuery('#menu1'); 49 var mobNav = 50 '<div class="mob-nav"><span class="back-icon"></span> Tagasi</div>'; 51 winW = jQuery(window).width(); 52 53 /* // TODO: REWORK THIS FUNCTION TO FIT OUR NEEDS 54 if( winW <= mobW ){ 55 jQuery('#logo').detach().prependTo('body'); 56 if( jQuery('.mob-nav').length === 0 ){ 57 jQuery('#left').prepend( mobNav ); 58 } 59 jQuery("#menu1 > li:has(ul)").removeClass('submenu'); 60 61 // language 3.11.15 62 jQuery('.moduletable_templang').detach().appendTo('#logo'); 63 64 } else{ 65 jQuery('#logo').detach().prependTo('#left'); 66 67 // language 3.11.15 68 jQuery('.moduletable_templang').detach().appendTo('#header-info'); 69 70 } 71*/ 72} 73 74function clearSearch() { 75 jQuery('#search-form')[0].reset(); 76 jQuery('#mobile-search-box').removeClass('mobile-search-boxActive'); 77 if (winW > 721) { 78 jQuery('#form-clear-btn').hide(); 79 } 80} 81 82function mobileMenu() { 83 var menu = jQuery('#left'); 84 var link = menu.find('a'); 85 var btn = '#mobilemenu'; 86 var navBtn = '.mob-nav'; 87 var activeClass = 'is-active'; 88 var searchBtn = '#search-mobile-btn'; 89 90 jQuery('body').on('click', searchBtn, function () { 91 jQuery('#mobile-search-box').toggleClass('mobile-search-boxActive'); 92 }); 93 94 /*========================= 95 Menu block visibility 96 ===========================*/ 97 98 jQuery('body').on('click', btn, function () { 99 menu.toggleClass(activeClass); 100 jQuery(btn).toggleClass(activeClass); 101 if (winW < 770) { 102 menu.find('li ul').addClass('is-hidden'); 103 menu.find('.active ul').removeClass('is-hidden'); 104 } 105 if (jQuery('li.parent.active').length === 0) { 106 jQuery('.mob-nav').slideUp(0); 107 } 108 if (jQuery('li.parent li.active').length > 0) { 109 jQuery('.mob-nav').slideDown(0); 110 } 111 }); 112 113 /*======================== 114 Menu back navigation 115 ==========================*/ 116 117 jQuery('body').on('click', navBtn, function () { 118 jQuery('.nav-child').addClass('is-hidden'); 119 jQuery('.mob-nav').slideUp(200); 120 }); 121 122 link.click(function (e) { 123 if (winW <= mobW) { 124 if (jQuery(this).parent().hasClass('parent')) { 125 e.preventDefault(); 126 jQuery(this).parent().find('ul').removeClass('is-hidden'); 127 jQuery('.mob-nav').slideDown(200); 128 } else { 129 } 130 } 131 }); 132}
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.