Dashboard: Don't trigger an Events search when the search field is empty.
Fixes #40816. Built from https://develop.svn.wordpress.org/trunk@40799 git-svn-id: http://core.svn.wordpress.org/trunk@40657 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
92642624fd
commit
1a8f7ab144
|
@ -234,10 +234,20 @@ jQuery( function( $ ) {
|
|||
$container.on( 'click', '.community-events-toggle-location, .community-events-cancel', app.toggleLocationForm );
|
||||
|
||||
$container.on( 'submit', '.community-events-form', function( event ) {
|
||||
var location = $.trim( $( '#community-events-location' ).val() );
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
/*
|
||||
* Don't trigger a search if the search field is empty or the
|
||||
* search term was made of only spaces before being trimmed.
|
||||
*/
|
||||
if ( ! location ) {
|
||||
return;
|
||||
}
|
||||
|
||||
app.getEvents({
|
||||
location: $( '#community-events-location' ).val()
|
||||
location: location
|
||||
});
|
||||
});
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.8-beta1-40798';
|
||||
$wp_version = '4.8-beta1-40799';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue