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.


git-svn-id: https://develop.svn.wordpress.org/trunk@40396 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Weston Ruter 2017-04-07 20:21:46 +00:00
parent e896940a4e
commit 3b794d15ae

View File

@ -1331,8 +1331,14 @@
this.container.find( '.menu-item-handle' ).on( 'click', function( e ) {
e.preventDefault();
e.stopPropagation();
api.Menus.availableMenuItemsPanel.close();
var menuControl = control.getMenuControl();
var menuControl = control.getMenuControl(),
isDeleteBtn = $( e.target ).is( '.item-delete, .item-delete *' ),
isAddNewBtn = $( e.target ).is( '.add-new-menu-item, .add-new-menu-item *' );
if ( $( 'body' ).hasClass( 'adding-menu-items' ) && ! isDeleteBtn && ! isAddNewBtn ) {
api.Menus.availableMenuItemsPanel.close();
}
if ( menuControl.isReordering || menuControl.isSorting ) {
return;
}
@ -2223,7 +2229,7 @@
}
} );
control.container.find( '.menu-delete' ).on( 'click', function( event ) {
control.container.find( '.menu-delete-item' ).on( 'click', function( event ) {
event.stopPropagation();
event.preventDefault();
control.setting.set( false );