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 697697 // Push and pop states are used to add search results to the browser
698698 // history.
699699 if ( browserSupportsHistoryApi ( ) ) {
700+ // Store the previous <title> so we can revert back to it later.
701+ var previousTitle = $ ( document ) . prop ( "title" ) ;
702+
700703 $ ( window ) . on ( 'popstate' , function ( e ) {
701704 var params = getQueryStringParams ( ) ;
702705 // When browsing back from search results the main page
705708 $ ( '#main.content' ) . removeClass ( 'hidden' ) ;
706709 $ ( '#search.content' ) . addClass ( 'hidden' ) ;
707710 }
711+ // Revert to the previous title manually since the History
712+ // API ignores the title parameter.
713+ $ ( document ) . prop ( "title" , previousTitle ) ;
708714 // When browsing forward to search results the previous
709715 // search will be repeated, so the currentResults are
710716 // cleared to ensure the search is successful.
You can’t perform that action at this time.
0 commit comments