1/** 2 * Copyright (c) 2016 Gian MR 3 * Gian MR Theme Custom Javascript 4 * 5 * @package idtheme 6 */ 7 8var $ = jQuery.noConflict(); 9 10(function( $ ) { 11 /* http://www.w3schools.com/js/js_strict.asp */ 12 "use strict"; 13 14 $( document ).ready( 15 function () { 16 /* Sidr Resposive Menu */ 17 $( '#gmr-responsive-menu' ).sidr( 18 { 19 name: 'menus', 20 source: '.gmr-logo, .close-topnavmenu-wrap, .gmr-mainmenu', 21 displace: false 22 } 23 ); 24 $( window ).resize( 25 function() { 26 $.sidr( 'close', 'menus' ); 27 } 28 ); 29 $( '#sidr-id-close-topnavmenu-button' ).click( 30 function(e){ 31 e.preventDefault(); 32 $.sidr( 'close', 'menus' ); 33 } 34 ); 35 $( '.sidr-inner li' ).each( 36 function(index) { 37 var item = $( this ); 38 if (item.find( 'ul' ).length > 0) { 39 // Has submenus. 40 item.find( 'a' ).first().append( '<span class="sub-toggle"><span class="arrow_carrot-down"></span></span>' ); 41 } 42 } 43 ); 44 $( '.sidr-inner .sub-toggle' ).click( 45 function(e) { 46 e.preventDefault(); 47 var item = $( this ), 48 txt; 49 item.toggleClass( 'is-open' ); 50 txt = item.hasClass( 'is-open' ) ? '<span class="arrow_carrot-up"></span>' : '<span class="arrow_carrot-down"></span>'; 51 item.html( txt ); 52 $( this ).closest( 'li' ).find( 'a' ).first().next().slideToggle(); 53 } 54 ); 55 } 56 ); /* End document Ready */ 57 58 /* Accessibility Drop Down Menu */ 59 jQuery( 60 function($) { 61 $( '.menu-item-has-children a' ).focus( 62 function () { 63 $( this ).siblings( '.sub-menu' ).addClass( 'focused' ); 64 } 65 ).blur( 66 function(){ 67 $( this ).siblings( '.sub-menu' ).removeClass( 'focused' ); 68 } 69 ); 70 /* Sub Menu */ 71 $( '.sub-menu a' ).focus( 72 function () { 73 $( this ).parents( '.sub-menu' ).addClass( 'focused' ); 74 } 75 ).blur( 76 function(){ 77 $( this ).parents( '.sub-menu' ).removeClass( 'focused' ); 78 } 79 ); 80 } 81 ); /* End jQuery(function($) { */ 82 83 /* Sticky Menu */ 84 jQuery( 85 function($) { 86 $( window ).scroll( 87 function() { 88 if ( $( this ).scrollTop() > 85 ) { 89 $( '.top-header, .site-header' ).addClass( 'sticky-menu' ); 90 } else { 91 $( '.top-header, .site-header' ).removeClass( 'sticky-menu' ); 92 } 93 } 94 ); 95 } 96 ); /* End jQuery(function($) { */ 97 98 /* Search Dropdown */ 99 jQuery( 100 function($) { 101 $( '#search-menu-button' ).click( 102 function(e) { 103 e.stopPropagation(); 104 e.preventDefault(); 105 $( '#search-dropdown-container' ).toggle(); 106 } 107 ); 108 $( '#search-menu-button-top' ).click( 109 function(e) { 110 e.stopPropagation(); 111 e.preventDefault(); 112 $( '.topsearchform' ).toggleClass( "open" ); 113 } 114 ); 115 $( document ).click( 116 function(e) { 117 var container = $( "#search-dropdown-container" ); 118 var btn = $( "#search-menu-button" ); 119 120 var container_2 = $( ".topsearchform" ); 121 var btn_2 = $( "#search-menu-button-top" ); 122 123 if (container.has( e.target ).length === 0 && btn.has( e.target ).length === 0) { 124 container.hide(); 125 } 126 if (container_2.has( e.target ).length === 0 && btn_2.has( e.target ).length === 0) { 127 container_2.removeClass( "open" ); 128 } 129 } 130 ); 131 } 132 ); /* End jQuery(function($) { */ 133 134})( jQuery ); 135 136/** 137 * File skip-link-focus-fix.js. 138 * 139 * Helps with accessibility for keyboard only users. 140 * 141 * Learn more: https://git.io/vWdr2 142 */ 143(function() { 144 var isIe = /(trident|msie)/i.test( navigator.userAgent ); 145 146 if ( isIe && document.getElementById && window.addEventListener ) { 147 window.addEventListener( 148 'hashchange', 149 function() { 150 var id = location.hash.substring( 1 ), 151 element; 152 153 if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) { 154 return; 155 } 156 157 element = document.getElementById( id ); 158 159 if ( element ) { 160 if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) { 161 element.tabIndex = -1; 162 } 163 164 element.focus(); 165 } 166 }, 167 false 168 ); 169 } 170})();
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.