File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
src/librustdoc/html/static Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 701701 // Push and pop states are used to add search results to the browser
702702 // history.
703703 if ( browserSupportsHistoryApi ( ) ) {
704+ // Store the previous <title> so we can revert back to it later.
705+ var previousTitle = $ ( document ) . prop ( "title" ) ;
706+
704707 $ ( window ) . on ( 'popstate' , function ( e ) {
705708 var params = getQueryStringParams ( ) ;
706709 // When browsing back from search results the main page
709712 $ ( '#main.content' ) . removeClass ( 'hidden' ) ;
710713 $ ( '#search.content' ) . addClass ( 'hidden' ) ;
711714 }
715+ // Revert to the previous title manually since the History
716+ // API ignores the title parameter.
717+ $ ( document ) . prop ( "title" , previousTitle ) ;
712718 // When browsing forward to search results the previous
713719 // search will be repeated, so the currentResults are
714720 // cleared to ensure the search is successful.
You can’t perform that action at this time.
0 commit comments