Twenty Twelve: make submenu links work correctly on tablets. Props tar.gz, purzlbaum, DavidTheMachine. See #24767.
git-svn-id: https://develop.svn.wordpress.org/trunk@28700 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
6779256079
commit
1ff9d938af
@ -40,4 +40,16 @@
|
||||
$( '.main-navigation' ).find( 'a' ).on( 'focus.twentytwelve blur.twentytwelve', function() {
|
||||
$( this ).parents( '.menu-item, .page_item' ).toggleClass( 'focus' );
|
||||
} );
|
||||
|
||||
if ( 'ontouchstart' in window ) {
|
||||
$( '.menu-item-has-children > a' ).on( 'touchstart.twentytwelve', function( e ) {
|
||||
var el = $( this ).parent( 'li' );
|
||||
|
||||
if ( ! el.hasClass( 'focus' ) ) {
|
||||
e.preventDefault();
|
||||
el.toggleClass( 'focus' );
|
||||
el.siblings( '.focus').removeClass( 'focus' );
|
||||
}
|
||||
} );
|
||||
}
|
||||
} )( jQuery );
|
||||
|
Loading…
Reference in New Issue
Block a user