WordPress.org

Make WordPress Core

Changeset 40396


Ignore:
Timestamp:
04/07/17 20:21:46 (7 months ago)
Author:
westonruter
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.

File:
1 edited

Legend:

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

    r39994 r40396  
    13321332                e.preventDefault(); 
    13331333                e.stopPropagation(); 
    1334                 api.Menus.availableMenuItemsPanel.close(); 
    1335                 var menuControl = control.getMenuControl(); 
     1334                var menuControl = control.getMenuControl(), 
     1335                    isDeleteBtn = $( e.target ).is( '.item-delete, .item-delete *' ), 
     1336                    isAddNewBtn = $( e.target ).is( '.add-new-menu-item, .add-new-menu-item *' ); 
     1337 
     1338                if ( $( 'body' ).hasClass( 'adding-menu-items' ) && ! isDeleteBtn && ! isAddNewBtn ) { 
     1339                    api.Menus.availableMenuItemsPanel.close(); 
     1340                } 
     1341 
    13361342                if ( menuControl.isReordering || menuControl.isSorting ) { 
    13371343                    return; 
     
    22242230            } ); 
    22252231 
    2226             control.container.find( '.menu-delete' ).on( 'click', function( event ) { 
     2232            control.container.find( '.menu-delete-item' ).on( 'click', function( event ) { 
    22272233                event.stopPropagation(); 
    22282234                event.preventDefault(); 
Note: See TracChangeset for help on using the changeset viewer.