We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 303cc00 commit 57cfae0Copy full SHA for 57cfae0
src/wp-content/themes/twentyfourteen/js/functions.js
@@ -107,10 +107,15 @@
107
return;
108
}
109
110
+ // Remove existing handlers to avoid duplicates.
111
+ navMenus.find( 'a' ).off( 'focus.twentyfourteen blur.twentyfourteen' );
112
+
113
+ // Add focus handlers.
114
+ navMenus.find( 'a' ).on( 'focus.twentyfourteen blur.twentyfourteen', function() {
115
+ $( this ).parents().toggleClass( 'focus' );
116
+ } );
117
118
if ( 783 > _window.width() ) {
- $( '.primary-navigation, .secondary-navigation' ).find( 'a' ).on( 'focus.twentyfourteen blur.twentyfourteen', function() {
- $( this ).parents().toggleClass( 'focus' );
- } );
119
if ( 'ontouchstart' in window ) {
120
$( document.body ).off( 'touchstart.twentyfourteen' );
121
0 commit comments