Themes: For searches, replace the document hash, don't add a new history event for each keypress. See #25948

git-svn-id: https://develop.svn.wordpress.org/trunk@26515 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2013-12-02 01:50:24 +00:00
parent c6e661e84d
commit 8eedbe32ac

View File

@ -591,10 +591,11 @@ themes.view.Search = wp.Backbone.View.extend({
this.collection.doSearch( event.target.value );
// Update the URL hash
if ( event.target.value )
themes.router.navigate( 'search/' + event.target.value );
else
if ( event.target.value ) {
themes.router.navigate( 'search/' + event.target.value, { replace: true } );
} else {
themes.router.navigate( '' );
}
}
});