File tree 1 file changed +6
-0
lines changed
src/librustdoc/html/static 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 697
697
// Push and pop states are used to add search results to the browser
698
698
// history.
699
699
if ( browserSupportsHistoryApi ( ) ) {
700
+ // Store the previous <title> so we can revert back to it later.
701
+ var previousTitle = $ ( document ) . prop ( "title" ) ;
702
+
700
703
$ ( window ) . on ( 'popstate' , function ( e ) {
701
704
var params = getQueryStringParams ( ) ;
702
705
// When browsing back from search results the main page
705
708
$ ( '#main.content' ) . removeClass ( 'hidden' ) ;
706
709
$ ( '#search.content' ) . addClass ( 'hidden' ) ;
707
710
}
711
+ // Revert to the previous title manually since the History
712
+ // API ignores the title parameter.
713
+ $ ( document ) . prop ( "title" , previousTitle ) ;
708
714
// When browsing forward to search results the previous
709
715
// search will be repeated, so the currentResults are
710
716
// cleared to ensure the search is successful.
You can’t perform that action at this time.
0 commit comments