Make WordPress Core

Ticket #30575: #30575.patch

File #30575.patch, 1.1 KB (added by rehanali, 4 years ago)

Added patch

  • functions.js

     
    119119                $( '.primary-navigation, .secondary-navigation' ).find( 'a' ).on( 'focus.twentyfourteen blur.twentyfourteen', function() {
    120120                        $( this ).parents().toggleClass( 'focus' );
    121121                } );
    122         } );
     122                  // Enable hover for dropdown menu for touch devices
     123              if ( 'ontouchstart' in window ) {
     124                           $('body').on( 'touchstart.twentyfourteen',  '.menu-item-has-children > a, .page_item_has_children > a', function( e ) {
     125                         var el = $( this ).parent( 'li' );
     126       
     127                                 if ( ! el.hasClass( 'focus' ) ) {
     128                                                e.preventDefault();
     129                                                el.toggleClass( 'focus' );
     130                                         el.siblings( '.focus').removeClass( 'focus' );
     131                                        }
     132                           });
     133                        }
     134        });
    123135
    124136        /**
    125137         * Add or remove ARIA attributes.