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

Built from https://develop.svn.wordpress.org/trunk@26691


git-svn-id: http://core.svn.wordpress.org/trunk@26581 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Lance Willett 2013-12-05 21:28:11 +00:00
parent 1788d5840f
commit 017fd0b083
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