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:
parent
56b0a18ac2
commit
ef1c3e09ac
@ -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' );
|
add_action( 'wp_enqueue_scripts', 'twentyfourteen_scripts' );
|
||||||
|
|
||||||
|
@ -56,14 +56,14 @@
|
|||||||
|
|
||||||
$( function() {
|
$( function() {
|
||||||
// Search toggle.
|
// Search toggle.
|
||||||
$( '.search-toggle' ).on( 'click.twentyfourteen', function() {
|
$( '.search-toggle' ).on( 'click.twentyfourteen', function( event ) {
|
||||||
var that = $( this ),
|
var that = $( this ),
|
||||||
wrapper = $( '.search-box-wrapper' );
|
wrapper = $( '.search-box-wrapper' );
|
||||||
|
|
||||||
that.toggleClass( 'active' );
|
that.toggleClass( 'active' );
|
||||||
wrapper.toggleClass( 'hide' );
|
wrapper.toggleClass( 'hide' );
|
||||||
|
|
||||||
if ( that.is( '.active' ) ) {
|
if ( that.is( '.active' ) || $( '.screen-reader-text' ) === event.target ) {
|
||||||
wrapper.find( '.search-field' ).focus();
|
wrapper.find( '.search-field' ).focus();
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
@ -903,10 +903,6 @@ span + .edit-link:before,
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-toggle .screen-reader-text {
|
|
||||||
right: 0; /* This makes sure a horizontal scrollbar won't appear */
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 5.0 Navigation
|
* 5.0 Navigation
|
||||||
|
Loading…
Reference in New Issue
Block a user