Skip to content

Commit c9e6d9a

Browse files
committed
Merge branch 'fix-26673' of https://github.com/nhowell/rust into rollup_central
2 parents d354d41 + 36882a0 commit c9e6d9a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/librustdoc/html/static/main.js

+6
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,9 @@
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
@@ -709,6 +712,9 @@
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.

0 commit comments

Comments
 (0)