mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-18 14:21:25 +01:00
Customize: Ensure that widgets and nav-menus can be closed after entering content.
Previously, the ⌧ button would close the search panel, or remove the results. This restores that, in addition pressing escape will do the same. Fixes #48198. Props garrett-eclipse, tobifjellner, afercia, JavierCasares. Built from https://develop.svn.wordpress.org/trunk@48461 git-svn-id: http://core.svn.wordpress.org/trunk@48230 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c7617838b1
commit
ac2a1c341d
@ -216,9 +216,9 @@
|
|||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
// Clear the search results and trigger a `keyup` event to fire a new search.
|
// Clear the search results and trigger an `input` event to fire a new search.
|
||||||
this.$clearResults.on( 'click', function() {
|
this.$clearResults.on( 'click', function() {
|
||||||
self.$search.val( '' ).focus().trigger( 'keyup' );
|
self.$search.val( '' ).focus().trigger( 'input' );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
this.$el.on( 'input', '#custom-menu-item-name.invalid, #custom-menu-item-url.invalid', function() {
|
this.$el.on( 'input', '#custom-menu-item-name.invalid, #custom-menu-item-url.invalid', function() {
|
||||||
@ -733,7 +733,7 @@
|
|||||||
$( 'body' ).removeClass( 'adding-menu-items' );
|
$( 'body' ).removeClass( 'adding-menu-items' );
|
||||||
$( '#available-menu-items .menu-item-handle.item-added' ).removeClass( 'item-added' );
|
$( '#available-menu-items .menu-item-handle.item-added' ).removeClass( 'item-added' );
|
||||||
|
|
||||||
this.$search.val( '' ).trigger( 'keyup' );
|
this.$search.val( '' ).trigger( 'input' );
|
||||||
},
|
},
|
||||||
|
|
||||||
// Add a few keyboard enhancements to the panel.
|
// Add a few keyboard enhancements to the panel.
|
||||||
@ -1819,10 +1819,10 @@
|
|||||||
/*
|
/*
|
||||||
* If the menu item deleted is the only of its instance left,
|
* If the menu item deleted is the only of its instance left,
|
||||||
* remove the check icon of this menu item in the right panel.
|
* remove the check icon of this menu item in the right panel.
|
||||||
*/
|
*/
|
||||||
_.each( addedItems, function( addedItem ) {
|
_.each( addedItems, function( addedItem ) {
|
||||||
var menuItemId, menuItemControl, matches;
|
var menuItemId, menuItemControl, matches;
|
||||||
|
|
||||||
// This is because menu item that's deleted is just hidden.
|
// This is because menu item that's deleted is just hidden.
|
||||||
if ( ! $( addedItem ).is( ':visible' ) ) {
|
if ( ! $( addedItem ).is( ':visible' ) ) {
|
||||||
return;
|
return;
|
||||||
|
2
wp-admin/js/customize-nav-menus.min.js
vendored
2
wp-admin/js/customize-nav-menus.min.js
vendored
File diff suppressed because one or more lines are too long
@ -193,10 +193,9 @@
|
|||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
// Clear the search results and trigger a new search.
|
// Clear the search results and trigger an `input` event to fire a new search.
|
||||||
this.$clearResults.on( 'click', function() {
|
this.$clearResults.on( 'click', function() {
|
||||||
self.$search.val( '' ).focus();
|
self.$search.val( '' ).focus().trigger( 'input' );
|
||||||
self.collection.doSearch( '' );
|
|
||||||
} );
|
} );
|
||||||
|
|
||||||
// Close the panel if the URL in the preview changes.
|
// Close the panel if the URL in the preview changes.
|
||||||
@ -385,7 +384,7 @@
|
|||||||
|
|
||||||
$( 'body' ).removeClass( 'adding-widget' );
|
$( 'body' ).removeClass( 'adding-widget' );
|
||||||
|
|
||||||
this.$search.val( '' );
|
this.$search.val( '' ).trigger( 'input' );
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
2
wp-admin/js/customize-widgets.min.js
vendored
2
wp-admin/js/customize-widgets.min.js
vendored
File diff suppressed because one or more lines are too long
@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.5-beta1-48460';
|
$wp_version = '5.5-beta1-48461';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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
Block a user