Make WordPress Core

Changeset 29095


Ignore:
Timestamp:
07/11/2014 05:46:11 PM (10 years ago)
Author:
lancewillett
Message:

Twenty Twelve: make small-screen menu accessible to keyboard commands and voice-driven software by using a focusable button element rather than h3 for the toggle element. Fixes #28224, props rclations.

Location:
trunk/src/wp-content/themes/twentytwelve
Files:
4 edited

Legend:

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

    r28702 r29095  
    141141
    142142    // Adds JavaScript for handling the navigation menu hide-and-show behavior.
    143     wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array( 'jquery' ), '20140608', true );
     143    wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array( 'jquery' ), '20140711', true );
    144144
    145145    $font_url = twentytwelve_get_font_url();
  • trunk/src/wp-content/themes/twentytwelve/header.php

    r28341 r29095  
    4141
    4242        <nav id="site-navigation" class="main-navigation" role="navigation">
    43             <h3 class="menu-toggle"><?php _e( 'Menu', 'twentytwelve' ); ?></h3>
     43            <button class="menu-toggle"><?php _e( 'Menu', 'twentytwelve' ); ?></button>
    4444            <a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentytwelve' ); ?>"><?php _e( 'Skip to content', 'twentytwelve' ); ?></a>
    4545            <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>
  • trunk/src/wp-content/themes/twentytwelve/js/navigation.js

    r28700 r29095  
    99    }
    1010
    11     button = nav.getElementsByTagName( 'h3' )[0];
     11    button = nav.getElementsByTagName( 'button' )[0];
    1212    menu   = nav.getElementsByTagName( 'ul' )[0];
    1313    if ( ! button ) {
  • trunk/src/wp-content/themes/twentytwelve/style.css

    r28166 r29095  
    273273}
    274274.menu-toggle:hover,
     275.menu-toggle:focus,
    275276button:hover,
    276277input[type="submit"]:hover,
Note: See TracChangeset for help on using the changeset viewer.