From 8eedbe32acac48e641638cc5f5d908310f3f2b00 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Mon, 2 Dec 2013 01:50:24 +0000 Subject: [PATCH] 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 --- src/wp-admin/js/theme.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/js/theme.js b/src/wp-admin/js/theme.js index 609da703bc..85825e3e86 100644 --- a/src/wp-admin/js/theme.js +++ b/src/wp-admin/js/theme.js @@ -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( '' ); + } } });