WordPress.org

Make WordPress Core

Ticket #38397: 38397.diff

File 38397.diff, 1.0 KB (added by voldemortensen, 4 years ago)
  • src/wp-content/themes/twentyseventeen/assets/js/navigation.js

     
    2626                container.find( '.current-menu-ancestor > button' ).addClass( 'toggled-on' );
    2727                container.find( '.current-menu-ancestor > .sub-menu' ).addClass( 'toggled-on' );
    2828
    29                 // Add menu items with submenus to aria-haspopup="true".
    30                 container.find( '.menu-item-has-children, .page_item_has_children' ).attr( 'aria-haspopup', 'true' );
     29                // Add aria-haspopup="true" to menu items with submenus, and only if not an IE Touch device.
     30                if (navigator.userAgent.toLowerCase().indexOf( 'msie' ) > -1 && navigator.msMaxTouchPoints) {
     31                        container.find( '.menu-item-has-children, .page_item_has_children' ).attr( 'aria-haspopup', 'true' );
     32                }
    3133
    3234                container.find( '.dropdown-toggle' ).click( function( e ) {
    3335                        var _this            = $( this ),