mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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: https://develop.svn.wordpress.org/trunk@24070 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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() );
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
if ( _window.innerWidth() > 644 ) {
|
||||
_window.on( 'scroll.twentythirteen', function() {
|
||||
var scrollOffset = scrollOffsetMethod ? document.documentElement.scrollTop : window.scrollY;
|
||||
|
||||
|
||||
if ( scrollOffset > navbarOffset )
|
||||
html.addClass( 'navbar-fixed' );
|
||||
else
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user