WordPress.org

Make WordPress Core

Changeset 40401


Ignore:
Timestamp:
04/10/17 12:28:08 (4 months ago)
Author:
swissspidy
Message:

Customize: Fix behavior of clicking Delete Menu link and keep available nav menu items panel open when doing bulk deletion.

Props maguiar, adamsilverstein for testing.
Amends [39548].
Fixes #38953.

Merges [40396] to the 4.7 branch.

Location:
branches/4.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

  • branches/4.7/src/wp-admin/js/customize-nav-menus.js

    r40094 r40401  
    13241324                e.preventDefault(); 
    13251325                e.stopPropagation(); 
    1326                 var menuControl = control.getMenuControl(); 
     1326                var menuControl = control.getMenuControl(), 
     1327                    isDeleteBtn = $( e.target ).is( '.item-delete, .item-delete *' ), 
     1328                    isAddNewBtn = $( e.target ).is( '.add-new-menu-item, .add-new-menu-item *' ); 
     1329 
     1330                if ( $( 'body' ).hasClass( 'adding-menu-items' ) && ! isDeleteBtn && ! isAddNewBtn ) { 
     1331                    api.Menus.availableMenuItemsPanel.close(); 
     1332                } 
     1333 
    13271334                if ( menuControl.isReordering || menuControl.isSorting ) { 
    13281335                    return; 
     
    22152222            } ); 
    22162223 
    2217             control.container.find( '.menu-delete' ).on( 'click', function( event ) { 
     2224            control.container.find( '.menu-delete-item' ).on( 'click', function( event ) { 
    22182225                event.stopPropagation(); 
    22192226                event.preventDefault(); 
Note: See TracChangeset for help on using the changeset viewer.