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 701
701
// Push and pop states are used to add search results to the browser
702
702
// history.
703
703
if ( browserSupportsHistoryApi ( ) ) {
704
+ // Store the previous <title> so we can revert back to it later.
705
+ var previousTitle = $ ( document ) . prop ( "title" ) ;
706
+
704
707
$ ( window ) . on ( 'popstate' , function ( e ) {
705
708
var params = getQueryStringParams ( ) ;
706
709
// When browsing back from search results the main page
709
712
$ ( '#main.content' ) . removeClass ( 'hidden' ) ;
710
713
$ ( '#search.content' ) . addClass ( 'hidden' ) ;
711
714
}
715
+ // Revert to the previous title manually since the History
716
+ // API ignores the title parameter.
717
+ $ ( document ) . prop ( "title" , previousTitle ) ;
712
718
// When browsing forward to search results the previous
713
719
// search will be repeated, so the currentResults are
714
720
// cleared to ensure the search is successful.
You can’t perform that action at this time.
0 commit comments