mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Twenty Thirteen: make submenu links work correctly on tablets. Props tar.gz, purzlbaum, DavidTheMachine. See #24767.
Built from https://develop.svn.wordpress.org/trunk@28699 git-svn-id: http://core.svn.wordpress.org/trunk@28516 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8ded986462
commit
550a0ef768
@ -170,7 +170,7 @@ function twentythirteen_scripts_styles() {
|
||||
wp_enqueue_script( 'jquery-masonry' );
|
||||
|
||||
// Loads JavaScript file with functionality specific to Twenty Thirteen.
|
||||
wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '2014-03-18', true );
|
||||
wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '2014-06-08', true );
|
||||
|
||||
// Add Source Sans Pro and Bitter fonts, used in the main stylesheet.
|
||||
wp_enqueue_style( 'twentythirteen-fonts', twentythirteen_fonts_url(), array(), null );
|
||||
|
@ -50,6 +50,19 @@
|
||||
nav.toggleClass( 'toggled-on' );
|
||||
} );
|
||||
|
||||
// Fix sub-menus for touch devices.
|
||||
if ( 'ontouchstart' in window ) {
|
||||
menu.find( '.menu-item-has-children > a' ).on( 'touchstart.twentythirteen', function( e ) {
|
||||
var el = $( this ).parent( 'li' );
|
||||
|
||||
if ( ! el.hasClass( 'focus' ) ) {
|
||||
e.preventDefault();
|
||||
el.toggleClass( 'focus' );
|
||||
el.siblings( '.focus' ).removeClass( 'focus' );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
// Better focus for hidden submenu items for accessibility.
|
||||
menu.find( 'a' ).on( 'focus.twentythirteen blur.twentythirteen', function() {
|
||||
$( this ).parents( '.menu-item, .page_item' ).toggleClass( 'focus' );
|
||||
|
@ -2895,8 +2895,8 @@ footer.entry-meta {
|
||||
color: #141412;
|
||||
}
|
||||
|
||||
.toggled-on .nav-menu li a:hover,
|
||||
.toggled-on .nav-menu ul a:hover {
|
||||
.toggled-on .nav-menu > li a:hover,
|
||||
.toggled-on .nav-menu > ul a:hover {
|
||||
background-color: #db572f;
|
||||
color: #fff;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user