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

Built from https://develop.svn.wordpress.org/trunk@26515


git-svn-id: http://core.svn.wordpress.org/trunk@26408 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dion Hulse 2013-12-02 01:51:09 +00:00
parent 527efd828c
commit f1f6cec5e8
2 changed files with 5 additions and 4 deletions

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( '' );
}
}
});

File diff suppressed because one or more lines are too long