From 578abd07969ba600c36075ae05c1e6c0cc6a9e1d Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Thu, 10 Oct 2013 15:33:10 +0000 Subject: [PATCH] Twenty Fourteen: improved JS support for keyboard navigation for main navigation menu. Props obenland, see #25054. Built from https://develop.svn.wordpress.org/trunk@25757 git-svn-id: http://core.svn.wordpress.org/trunk@25670 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentyfourteen/js/theme.js | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/wp-content/themes/twentyfourteen/js/theme.js b/wp-content/themes/twentyfourteen/js/theme.js index 96ca838c3e..e7788bf2a3 100644 --- a/wp-content/themes/twentyfourteen/js/theme.js +++ b/wp-content/themes/twentyfourteen/js/theme.js @@ -117,16 +117,8 @@ } ); - /* Accessibility hover styles for menu. */ - $( '.primary-navigation li' ).hover( function() { - $( this ).addClass( 'a11y-focus' ); - }, function() { - $( this ).delay( '250' ).removeClass( 'a11y-focus' ); - } - ); - $( '.primary-navigation li a' ).on( 'focus blur', function() { - $( this ).parents().toggleClass( 'a11y-focus' ); - } - ); - + /* Focus styles for primary menu. */ + $( '.primary-navigation' ).find( 'a' ).on( 'focus.twentyfourteen blur.twentyfourteen', function() { + $( this ).parents().toggleClass( 'focus' ); + }); } )( jQuery ); \ No newline at end of file