From 8a0a5ce1d2bac0b18e60c5e0dd795dedf3655178 Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Fri, 11 Jul 2014 17:47:14 +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. Built from https://develop.svn.wordpress.org/trunk@29095 git-svn-id: http://core.svn.wordpress.org/trunk@28881 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentytwelve/functions.php | 2 +- wp-content/themes/twentytwelve/header.php | 2 +- wp-content/themes/twentytwelve/js/navigation.js | 2 +- wp-content/themes/twentytwelve/style.css | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/wp-content/themes/twentytwelve/functions.php b/wp-content/themes/twentytwelve/functions.php index 48ece08faa..38ea36ec74 100644 --- a/wp-content/themes/twentytwelve/functions.php +++ b/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/wp-content/themes/twentytwelve/header.php b/wp-content/themes/twentytwelve/header.php index 6a665a5573..8dcd9a99ed 100644 --- a/wp-content/themes/twentytwelve/header.php +++ b/wp-content/themes/twentytwelve/header.php @@ -40,7 +40,7 @@ diff --git a/wp-content/themes/twentytwelve/js/navigation.js b/wp-content/themes/twentytwelve/js/navigation.js index 383077ad59..34a640246e 100644 --- a/wp-content/themes/twentytwelve/js/navigation.js +++ b/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/wp-content/themes/twentytwelve/style.css b/wp-content/themes/twentytwelve/style.css index 110332867f..a35f96ab1d 100644 --- a/wp-content/themes/twentytwelve/style.css +++ b/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,