Menus: Fix the posts-categories quick search.
On the Menus screen, events that trigger the posts-categories search need to be delegated. This "boxes" may get dynamically rebuilt so events directly attached to the search input field need to be delegated. Fixes #38324. Built from https://develop.svn.wordpress.org/trunk@38799 git-svn-id: http://core.svn.wordpress.org/trunk@38742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -887,17 +887,21 @@ var wpNavMenu;
|
||||
inputEvent = 'keyup';
|
||||
}
|
||||
|
||||
$( '.quick-search' ).on( inputEvent, function() {
|
||||
var t = $(this);
|
||||
$( '#nav-menu-meta' ).on( inputEvent, '.quick-search', function() {
|
||||
var $this = $( this );
|
||||
|
||||
if( searchTimer ) clearTimeout(searchTimer);
|
||||
$this.attr( 'autocomplete', 'off' );
|
||||
|
||||
searchTimer = setTimeout(function(){
|
||||
api.updateQuickSearchResults( t );
|
||||
}, 500 );
|
||||
}).on( 'blur', function() {
|
||||
if ( searchTimer ) {
|
||||
clearTimeout( searchTimer );
|
||||
}
|
||||
|
||||
searchTimer = setTimeout( function() {
|
||||
api.updateQuickSearchResults( $this );
|
||||
}, 500 );
|
||||
}).on( 'blur', '.quick-search', function() {
|
||||
api.lastSearch = '';
|
||||
}).attr('autocomplete','off');
|
||||
});
|
||||
},
|
||||
|
||||
updateQuickSearchResults : function(input) {
|
||||
|
||||
2
wp-admin/js/nav-menu.min.js
vendored
2
wp-admin/js/nav-menu.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user