From b8340bc9bc288d89bf3de77acd0bc23fc03f946a Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Fri, 11 Jul 2014 17:46:11 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@29095 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-content/themes/twentytwelve/functions.php | 2 +- src/wp-content/themes/twentytwelve/header.php | 2 +- src/wp-content/themes/twentytwelve/js/navigation.js | 2 +- src/wp-content/themes/twentytwelve/style.css | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/wp-content/themes/twentytwelve/functions.php b/src/wp-content/themes/twentytwelve/functions.php index 48ece08faa..38ea36ec74 100644 --- a/src/wp-content/themes/twentytwelve/functions.php +++ b/src/wp-content/themes/twentytwelve/functions.php @@ -140,7 +140,7 @@ function twentytwelve_scripts_styles() { wp_enqueue_script( 'comment-reply' ); // Adds JavaScript for handling the navigation menu hide-and-show behavior. - wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array( 'jquery' ), '20140608', true ); + wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array( 'jquery' ), '20140711', true ); $font_url = twentytwelve_get_font_url(); if ( ! empty( $font_url ) ) diff --git a/src/wp-content/themes/twentytwelve/header.php b/src/wp-content/themes/twentytwelve/header.php index 6a665a5573..8dcd9a99ed 100644 --- a/src/wp-content/themes/twentytwelve/header.php +++ b/src/wp-content/themes/twentytwelve/header.php @@ -40,7 +40,7 @@ diff --git a/src/wp-content/themes/twentytwelve/js/navigation.js b/src/wp-content/themes/twentytwelve/js/navigation.js index 383077ad59..34a640246e 100644 --- a/src/wp-content/themes/twentytwelve/js/navigation.js +++ b/src/wp-content/themes/twentytwelve/js/navigation.js @@ -8,7 +8,7 @@ return; } - button = nav.getElementsByTagName( 'h3' )[0]; + button = nav.getElementsByTagName( 'button' )[0]; menu = nav.getElementsByTagName( 'ul' )[0]; if ( ! button ) { return; diff --git a/src/wp-content/themes/twentytwelve/style.css b/src/wp-content/themes/twentytwelve/style.css index 110332867f..a35f96ab1d 100644 --- a/src/wp-content/themes/twentytwelve/style.css +++ b/src/wp-content/themes/twentytwelve/style.css @@ -272,6 +272,7 @@ input[disabled] { cursor: default; } .menu-toggle:hover, +.menu-toggle:focus, button:hover, input[type="submit"]:hover, input[type="button"]:hover,