diff --git a/wp-content/themes/twentythirteen/functions.php b/wp-content/themes/twentythirteen/functions.php index dc0a266c9b..5474d07d3a 100644 --- a/wp-content/themes/twentythirteen/functions.php +++ b/wp-content/themes/twentythirteen/functions.php @@ -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 ); diff --git a/wp-content/themes/twentythirteen/js/functions.js b/wp-content/themes/twentythirteen/js/functions.js index 78c8c848c8..526c15d6b3 100644 --- a/wp-content/themes/twentythirteen/js/functions.js +++ b/wp-content/themes/twentythirteen/js/functions.js @@ -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' ); diff --git a/wp-content/themes/twentythirteen/style.css b/wp-content/themes/twentythirteen/style.css index c573b66b49..0ea9d8cc19 100644 --- a/wp-content/themes/twentythirteen/style.css +++ b/wp-content/themes/twentythirteen/style.css @@ -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; }