File tree Expand file tree Collapse file tree 2 files changed +3
-17
lines changed Expand file tree Collapse file tree 2 files changed +3
-17
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,6 @@ var $articleContainer,
4040 if ( noModifierKeys && sameHostname && sameProtocol ) {
4141 ev . preventDefault ( ) ;
4242 var href = this . href ;
43- window . history . pushState ( null , null , href ) ;
4443 navigate ( href ) ;
4544 }
4645 } ) ;
@@ -92,7 +91,6 @@ function init() {
9291 if ( ! searchControl ) {
9392 searchControl = new SearchControl ( ".search-bar" , {
9493 navigate : function ( href ) {
95- window . history . pushState ( null , null , href ) ;
9694 navigate ( href ) ;
9795 } ,
9896 pathPrefix : window . pathPrefix ,
@@ -249,8 +247,11 @@ function navigate(href) {
249247 if ( searchControl . searchResultsCache ) {
250248 searchControl . renderSearchResults ( searchControl . searchResultsCache ) ;
251249 }
250+
251+ window . history . pushState ( null , null , href ) ;
252252 } ,
253253 error : function ( ) {
254+ window . history . pushState ( null , null , href ) ;
254255 // just reload the page if this fails
255256 window . location . reload ( ) ;
256257 } ,
Original file line number Diff line number Diff line change @@ -463,21 +463,6 @@ var Search = Control.extend({
463463 self . clear ( ) ;
464464 } ) ;
465465 }
466-
467- // if we click the list item, navigate
468- // if the target element is an anchor tag, simply clear
469- if ( this . $resultsContainer && this . $resultsContainer . length ) {
470- this . $resultsContainer . on ( "click.search-component" , ".search-results > ul > li" , function ( ev ) {
471- var $target = $ ( ev . target ) ,
472- $a ;
473-
474- if ( ! $target . is ( "a" ) ) {
475- $a = $target . closest ( "li" ) . find ( "a" ) ;
476- self . navigate ( $a . attr ( "href" ) ) ;
477- return ;
478- }
479- } ) ;
480- }
481466 } ,
482467 unbindResultsEvents : function ( ) {
483468 //hide the search on cancel click
You can’t perform that action at this time.
0 commit comments