mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Customize: Collapse available nav menu items panel when clicking outside over preview or over existing items.
Props rockwell15. Fixes #38953. git-svn-id: https://develop.svn.wordpress.org/trunk@39548 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
3669b47260
commit
3caac42ac0
@ -719,6 +719,10 @@ body.adding-menu-items #customize-preview {
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
body.adding-menu-items #customize-preview iframe {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.menu-item-handle .spinner {
|
||||
display: none;
|
||||
float: left;
|
||||
|
||||
@ -665,12 +665,20 @@
|
||||
|
||||
// Opens the panel.
|
||||
open: function( menuControl ) {
|
||||
var panel = this, close;
|
||||
|
||||
this.currentMenuControl = menuControl;
|
||||
|
||||
this.itemSectionHeight();
|
||||
|
||||
$( 'body' ).addClass( 'adding-menu-items' );
|
||||
|
||||
close = function() {
|
||||
panel.close();
|
||||
$( this ).off( 'click', close );
|
||||
};
|
||||
$( '#customize-preview' ).on( 'click', close );
|
||||
|
||||
// Collapse all controls.
|
||||
_( this.currentMenuControl.getMenuItemControls() ).each( function( control ) {
|
||||
control.collapseForm();
|
||||
@ -1319,6 +1327,7 @@
|
||||
this.container.find( '.menu-item-handle' ).on( 'click', function( e ) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
api.Menus.availableMenuItemsPanel.close();
|
||||
var menuControl = control.getMenuControl();
|
||||
if ( menuControl.isReordering || menuControl.isSorting ) {
|
||||
return;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user