1/** 2 * This file fixes the browser bug for skip-links: While the visual focus of the browser shifts to the element being linked to, the input focus stays where it was. 3 * Affects Internet Explorer and Chrome 4 * https://www.nczonline.net/blog/2013/01/15/fixing-skip-to-content-links/ 5 * 6 * @package Genesis\JS 7 * @author StudioPress 8 */ 9 10/** 11 * Callback to fix skip links focus. 12 * 13 * @since 2.2.0 14 */ 15function ga_skiplinks() { 16 'use strict'; 17 var fragmentID = location.hash.substring( 1 ); 18 if ( ! fragmentID ) { 19 return; 20 } 21 22 var element = document.getElementById( fragmentID ); 23 if ( element ) { 24 if ( false === /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) { 25 element.tabIndex = -1; 26 } 27 element.focus(); 28 } 29} 30 31if ( window.addEventListener ) { 32 window.addEventListener( 'hashchange', ga_skiplinks, false ); 33} else { // IE8 and earlier. 34 window.attachEvent( 'onhashchange', ga_skiplinks ); 35}
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.