Make WordPress Core

Changeset 26691


Ignore:
Timestamp:
12/05/2013 09:27:20 PM (11 years ago)
Author:
lancewillett
Message:

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

Location:
trunk/src/wp-content/themes/twentyfourteen
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfourteen/functions.php

    r26689 r26691  
    263263    }
    264264
    265     wp_enqueue_script( 'twentyfourteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20131203', true );
     265    wp_enqueue_script( 'twentyfourteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20131205', true );
    266266}
    267267add_action( 'wp_enqueue_scripts', 'twentyfourteen_scripts' );
  • trunk/src/wp-content/themes/twentyfourteen/js/functions.js

    r26574 r26691  
    5757    $( function() {
    5858        // Search toggle.
    59         $( '.search-toggle' ).on( 'click.twentyfourteen', function() {
     59        $( '.search-toggle' ).on( 'click.twentyfourteen', function( event ) {
    6060            var that    = $( this ),
    6161                wrapper = $( '.search-box-wrapper' );
     
    6464            wrapper.toggleClass( 'hide' );
    6565
    66             if ( that.is( '.active' ) ) {
     66            if ( that.is( '.active' ) || $( '.screen-reader-text' ) === event.target ) {
    6767                wrapper.find( '.search-field' ).focus();
    6868            }
  • trunk/src/wp-content/themes/twentyfourteen/style.css

    r26689 r26691  
    904904}
    905905
    906 .search-toggle .screen-reader-text {
    907     right: 0; /* This makes sure a horizontal scrollbar won't appear */
    908 }
    909 
    910906
    911907/**
Note: See TracChangeset for help on using the changeset viewer.