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:
Lance Willett 2013-04-23 16:30:03 +00:00
parent ef052e29a1
commit 7edf4b4910
2 changed files with 5 additions and 5 deletions

View File

@ -224,7 +224,7 @@ function twentythirteen_scripts_styles() {
wp_enqueue_script( 'jquery-masonry' ); wp_enqueue_script( 'jquery-masonry' );
// Loads JavaScript file with functionality specific to Twenty Thirteen. // 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. // Loads our main stylesheet.
wp_enqueue_style( 'twentythirteen-style', get_stylesheet_uri() ); wp_enqueue_style( 'twentythirteen-style', get_stylesheet_uri() );

View File

@ -100,11 +100,11 @@
* @link http://www.nczonline.net/blog/2013/01/15/fixing-skip-to-content-links/ * @link http://www.nczonline.net/blog/2013/01/15/fixing-skip-to-content-links/
*/ */
_window.on( 'hashchange.twentythirteen', function() { _window.on( 'hashchange.twentythirteen', function() {
var element = $( location.hash ); var element = document.getElementById( location.hash.substring( 1 ) );
if ( element ) { if ( element ) {
if ( ! /^(?:a|select|input|button)$/i.test( element.tagName ) ) if ( ! /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) )
element.attr( 'tabindex', -1 ); element.tabIndex = -1;
element.focus(); element.focus();
} }