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:
parent
1788d5840f
commit
017fd0b083
|
@ -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' );
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
} );
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue