Twenty Fourteen: fix too-wide search "jump to" link and provide focus on the search input when it's used. Closes #25592.

git-svn-id: https://develop.svn.wordpress.org/trunk@26691 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Lance Willett 2013-12-05 21:27:20 +00:00
parent 56b0a18ac2
commit ef1c3e09ac
3 changed files with 3 additions and 7 deletions

View File

@ -262,7 +262,7 @@ function twentyfourteen_scripts() {
) );
}
wp_enqueue_script( 'twentyfourteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20131203', true );
wp_enqueue_script( 'twentyfourteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20131205', true );
}
add_action( 'wp_enqueue_scripts', 'twentyfourteen_scripts' );

View File

@ -56,14 +56,14 @@
$( function() {
// Search toggle.
$( '.search-toggle' ).on( 'click.twentyfourteen', function() {
$( '.search-toggle' ).on( 'click.twentyfourteen', function( event ) {
var that = $( this ),
wrapper = $( '.search-box-wrapper' );
that.toggleClass( 'active' );
wrapper.toggleClass( 'hide' );
if ( that.is( '.active' ) ) {
if ( that.is( '.active' ) || $( '.screen-reader-text' ) === event.target ) {
wrapper.find( '.search-field' ).focus();
}
} );

View File

@ -903,10 +903,6 @@ span + .edit-link:before,
width: 100%;
}
.search-toggle .screen-reader-text {
right: 0; /* This makes sure a horizontal scrollbar won't appear */
}
/**
* 5.0 Navigation