Customize: Collapse available nav menu items panel when clicking outside over preview or over existing items.
Props rockwell15. Fixes #38953. Built from https://develop.svn.wordpress.org/trunk@39548 git-svn-id: http://core.svn.wordpress.org/trunk@39488 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d10cde75c6
commit
d94530e721
|
@ -719,6 +719,10 @@ body.adding-menu-items #customize-preview {
|
||||||
opacity: 0.4;
|
opacity: 0.4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body.adding-menu-items #customize-preview iframe {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
.menu-item-handle .spinner {
|
.menu-item-handle .spinner {
|
||||||
display: none;
|
display: none;
|
||||||
float: right;
|
float: right;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -719,6 +719,10 @@ body.adding-menu-items #customize-preview {
|
||||||
opacity: 0.4;
|
opacity: 0.4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body.adding-menu-items #customize-preview iframe {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
.menu-item-handle .spinner {
|
.menu-item-handle .spinner {
|
||||||
display: none;
|
display: none;
|
||||||
float: left;
|
float: left;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -665,12 +665,20 @@
|
||||||
|
|
||||||
// Opens the panel.
|
// Opens the panel.
|
||||||
open: function( menuControl ) {
|
open: function( menuControl ) {
|
||||||
|
var panel = this, close;
|
||||||
|
|
||||||
this.currentMenuControl = menuControl;
|
this.currentMenuControl = menuControl;
|
||||||
|
|
||||||
this.itemSectionHeight();
|
this.itemSectionHeight();
|
||||||
|
|
||||||
$( 'body' ).addClass( 'adding-menu-items' );
|
$( 'body' ).addClass( 'adding-menu-items' );
|
||||||
|
|
||||||
|
close = function() {
|
||||||
|
panel.close();
|
||||||
|
$( this ).off( 'click', close );
|
||||||
|
};
|
||||||
|
$( '#customize-preview' ).on( 'click', close );
|
||||||
|
|
||||||
// Collapse all controls.
|
// Collapse all controls.
|
||||||
_( this.currentMenuControl.getMenuItemControls() ).each( function( control ) {
|
_( this.currentMenuControl.getMenuItemControls() ).each( function( control ) {
|
||||||
control.collapseForm();
|
control.collapseForm();
|
||||||
|
@ -1319,6 +1327,7 @@
|
||||||
this.container.find( '.menu-item-handle' ).on( 'click', function( e ) {
|
this.container.find( '.menu-item-handle' ).on( 'click', function( e ) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
api.Menus.availableMenuItemsPanel.close();
|
||||||
var menuControl = control.getMenuControl();
|
var menuControl = control.getMenuControl();
|
||||||
if ( menuControl.isReordering || menuControl.isSorting ) {
|
if ( menuControl.isReordering || menuControl.isSorting ) {
|
||||||
return;
|
return;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.8-alpha-39547';
|
$wp_version = '4.8-alpha-39548';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue