Make WordPress Core

Changeset 24070


Ignore:
Timestamp:
04/23/2013 04:30:03 PM (13 years ago)
Author:
lancewillett
Message:

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.

Location:
trunk/wp-content/themes/twentythirteen
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentythirteen/functions.php

    r24036 r24070  
    225225
    226226        // Loads JavaScript file with functionality specific to Twenty Thirteen.
    227         wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20130416', true );
     227        wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20130423', true );
    228228
    229229        // Loads our main stylesheet.
  • trunk/wp-content/themes/twentythirteen/js/functions.js

    r24005 r24070  
    5353                _window.on( 'scroll.twentythirteen', function() {
    5454                        var scrollOffset = scrollOffsetMethod ? document.documentElement.scrollTop : window.scrollY;
    55        
     55
    5656                        if ( scrollOffset > navbarOffset )
    5757                                html.addClass( 'navbar-fixed' );
     
    101101         */
    102102        _window.on( 'hashchange.twentythirteen', function() {
    103                 var element = $( location.hash );
     103                var element = document.getElementById( location.hash.substring( 1 ) );
    104104
    105105                if ( element ) {
    106                         if ( ! /^(?:a|select|input|button)$/i.test( element.tagName ) )
    107                                 element.attr( 'tabindex', -1 );
     106                        if ( ! /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) )
     107                                element.tabIndex = -1;
    108108
    109109                        element.focus();
Note: See TracChangeset for help on using the changeset viewer.