mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 17:48:01 +01:00
Twenty Fourteen: add ARIA attributes to search toggle. See #31527.
Built from https://develop.svn.wordpress.org/trunk@31794 git-svn-id: http://core.svn.wordpress.org/trunk@31776 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0876c26025
commit
913c4cd69c
@ -45,7 +45,7 @@
|
||||
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
|
||||
|
||||
<div class="search-toggle">
|
||||
<a href="#search-container" class="screen-reader-text"><?php _e( 'Search', 'twentyfourteen' ); ?></a>
|
||||
<a href="#search-container" class="screen-reader-text" aria-expanded="false" aria-controls="search-container"><?php _e( 'Search', 'twentyfourteen' ); ?></a>
|
||||
</div>
|
||||
|
||||
<nav id="primary-navigation" class="site-navigation primary-navigation" role="navigation">
|
||||
|
@ -69,11 +69,18 @@
|
||||
// Search toggle.
|
||||
$( '.search-toggle' ).on( 'click.twentyfourteen', function( event ) {
|
||||
var that = $( this ),
|
||||
wrapper = $( '.search-box-wrapper' );
|
||||
wrapper = $( '#search-container' ),
|
||||
container = that.find( 'a' );
|
||||
|
||||
that.toggleClass( 'active' );
|
||||
wrapper.toggleClass( 'hide' );
|
||||
|
||||
if ( that.hasClass( 'active' ) ) {
|
||||
container.attr( 'aria-expanded', 'true' );
|
||||
} else {
|
||||
container.attr( 'aria-expanded', 'false' );
|
||||
}
|
||||
|
||||
if ( that.is( '.active' ) || $( '.search-toggle .screen-reader-text' )[0] === event.target ) {
|
||||
wrapper.find( '.search-field' ).focus();
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.2-beta1-31793';
|
||||
$wp_version = '4.2-beta1-31794';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user