Twenty Fourteen: match screen-reader-text accessibility styles a bit better with core, to avoid a jump when you move through the links, and to avoid a horizontal scroll at certain viewport widths. Also fix JS focus by specifying the first match object. Closes #25592.

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


git-svn-id: http://core.svn.wordpress.org/trunk@26730 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Lance Willett 2013-12-09 20:38:12 +00:00
parent 21b5149477
commit adb22a86fd
4 changed files with 8 additions and 4 deletions

View File

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

View File

@ -63,7 +63,7 @@
that.toggleClass( 'active' );
wrapper.toggleClass( 'hide' );
if ( that.is( '.active' ) || $( '.screen-reader-text' ) === event.target ) {
if ( that.is( '.active' ) || $( '.search-toggle .screen-reader-text' )[0] === event.target ) {
wrapper.find( '.search-field' ).focus();
}
} );

View File

@ -98,8 +98,8 @@ td {
}
.search-toggle .screen-reader-text {
right: auto;
left: 0;
right: 5px; /* Avoid a horizontal scrollbar when the site has a long menu */
left: auto;
}

View File

@ -878,6 +878,10 @@ span + .edit-link:before,
margin-top: 14px;
}
.search-toggle .screen-reader-text {
left: 5px; /* Avoid a horizontal scrollbar when the site has a long menu */
}
.search-box-wrapper {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;