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.

Built from https://develop.svn.wordpress.org/trunk@40396


git-svn-id: http://core.svn.wordpress.org/trunk@40303 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter 2017-04-07 20:22:43 +00:00
parent ad293eade7
commit 57b386ef1e
3 changed files with 12 additions and 6 deletions

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 );

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.8-alpha-40395';
$wp_version = '4.8-alpha-40396';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.