Twenty Thirteen: update JavaScript-based accessibility function hooked to `hashchange` event to verify user input correctly. Props mfields for the original patch.
Also add textarea to list of elements. See #23875. git-svn-id: http://core.svn.wordpress.org/trunk@24070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ef052e29a1
commit
7edf4b4910
|
@ -224,7 +224,7 @@ function twentythirteen_scripts_styles() {
|
|||
wp_enqueue_script( 'jquery-masonry' );
|
||||
|
||||
// Loads JavaScript file with functionality specific to Twenty Thirteen.
|
||||
wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20130416', true );
|
||||
wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20130423', true );
|
||||
|
||||
// Loads our main stylesheet.
|
||||
wp_enqueue_style( 'twentythirteen-style', get_stylesheet_uri() );
|
||||
|
|
|
@ -100,11 +100,11 @@
|
|||
* @link http://www.nczonline.net/blog/2013/01/15/fixing-skip-to-content-links/
|
||||
*/
|
||||
_window.on( 'hashchange.twentythirteen', function() {
|
||||
var element = $( location.hash );
|
||||
var element = document.getElementById( location.hash.substring( 1 ) );
|
||||
|
||||
if ( element ) {
|
||||
if ( ! /^(?:a|select|input|button)$/i.test( element.tagName ) )
|
||||
element.attr( 'tabindex', -1 );
|
||||
if ( ! /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) )
|
||||
element.tabIndex = -1;
|
||||
|
||||
element.focus();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue