Make WordPress Core

Changeset 33502


Ignore:
Timestamp:
07/29/2015 09:29:54 PM (10 years ago)
Author:
ocean90
Message:

Nav menus: Make the selector for the edit menu item link more specific. Prevents clashing with other elements which have the same class.

fixes #33129.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/nav-menu.js

    r33030 r33502  
    391391            // Refresh the accessibility when the user comes close to the item in any way
    392392            menu.on( 'mouseenter.refreshAccessibility focus.refreshAccessibility touchstart.refreshAccessibility' , '.menu-item' , function(){
    393                 api.refreshAdvancedAccessibilityOfItem( $( this ).find( '.item-edit' ) );
     393                api.refreshAdvancedAccessibilityOfItem( $( this ).find( 'a.item-edit' ) );
    394394            } );
    395395
    396396            // We have to update on click as well because we might hover first, change the item, and then click.
    397             menu.on( 'click', '.item-edit', function() {
     397            menu.on( 'click', 'a.item-edit', function() {
    398398                api.refreshAdvancedAccessibilityOfItem( $( this ) );
    399399            } );
     
    512512
    513513            // Mark all menu items as unprocessed
    514             $( '.item-edit' ).data( 'needs_accessibility_refresh', true );
     514            $( 'a.item-edit' ).data( 'needs_accessibility_refresh', true );
    515515
    516516            // All open items have to be refreshed or they will show no links
    517             $( '.menu-item-edit-active .item-edit' ).each( function() {
     517            $( '.menu-item-edit-active a.item-edit' ).each( function() {
    518518                api.refreshAdvancedAccessibilityOfItem( this );
    519519            } );
     
    521521
    522522        refreshKeyboardAccessibility : function() {
    523             $( '.item-edit' ).off( 'focus' ).on( 'focus', function(){
     523            $( 'a.item-edit' ).off( 'focus' ).on( 'focus', function(){
    524524                $(this).off( 'keydown' ).on( 'keydown', function(e){
    525525
Note: See TracChangeset for help on using the changeset viewer.