Make WordPress Core

Changeset 28699


Ignore:
Timestamp:
06/08/2014 06:47:58 PM (12 years ago)
Author:
lancewillett
Message:

Twenty Thirteen: make submenu links work correctly on tablets. Props tar.gz, purzlbaum, DavidTheMachine. See #24767.

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

Legend:

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

    r28693 r28699  
    171171
    172172        // Loads JavaScript file with functionality specific to Twenty Thirteen.
    173         wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '2014-03-18', true );
     173        wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '2014-06-08', true );
    174174
    175175        // Add Source Sans Pro and Bitter fonts, used in the main stylesheet.
  • trunk/src/wp-content/themes/twentythirteen/js/functions.js

    r27607 r28699  
    5151                } );
    5252
     53                // Fix sub-menus for touch devices.
     54                if ( 'ontouchstart' in window ) {
     55                        menu.find( '.menu-item-has-children > a' ).on( 'touchstart.twentythirteen', function( e ) {
     56                                var el = $( this ).parent( 'li' );
     57
     58                                if ( ! el.hasClass( 'focus' ) ) {
     59                                        e.preventDefault();
     60                                        el.toggleClass( 'focus' );
     61                                        el.siblings( '.focus' ).removeClass( 'focus' );
     62                                }
     63                        } );
     64                }
     65
    5366                // Better focus for hidden submenu items for accessibility.
    5467                menu.find( 'a' ).on( 'focus.twentythirteen blur.twentythirteen', function() {
  • trunk/src/wp-content/themes/twentythirteen/style.css

    r28662 r28699  
    28962896        }
    28972897
    2898         .toggled-on .nav-menu li a:hover,
    2899         .toggled-on .nav-menu ul a:hover {
     2898        .toggled-on .nav-menu > li a:hover,
     2899        .toggled-on .nav-menu > ul a:hover {
    29002900                background-color: #db572f;
    29012901                color: #fff;
Note: See TracChangeset for help on using the changeset viewer.