Make WordPress Core

Changeset 36523


Ignore:
Timestamp:
02/13/2016 12:11:24 AM (9 years ago)
Author:
westonruter
Message:

Customize: Ensure that nav menu items can be shift-clicked to edit in secondary instances of the same nav menu.

When the same nav menu is shown multiple times on a page, only the first instance of the nav menu will include id attributes. Subsequent instances will have the id attributes omitted. However, in both cases the underlying nav menu item's post ID is available among the class names, so the post ID can be more reliably obtained from class instead of the id attribute.

Amends [36383].
Fixes #32681.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/customize-preview-nav-menus.js

    r36414 r36523  
    280280         */
    281281        highlightControls: function() {
    282             var selector = '.menu-item[id^=menu-item-]',
     282            var selector = '.menu-item',
    283283                addTooltips;
    284284
     
    290290                }
    291291
    292                 navMenuItemParts = $( this ).attr( 'id' ).match( /^menu-item-(\d+)$/ );
     292                navMenuItemParts = $( this ).attr( 'class' ).match( /(?:^|\s)menu-item-(\d+)(?:\s|$)/ );
    293293                if ( navMenuItemParts ) {
    294294                    e.preventDefault();
Note: See TracChangeset for help on using the changeset viewer.