Skip to content

Commit

Permalink
Merge branch 'fix-26673' of https://github.com/nhowell/rust into roll…
Browse files Browse the repository at this point in the history
…up_central
  • Loading branch information
steveklabnik committed Jul 16, 2015
2 parents d354d41 + 36882a0 commit c9e6d9a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/librustdoc/html/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,9 @@
// Push and pop states are used to add search results to the browser
// history.
if (browserSupportsHistoryApi()) {
// Store the previous <title> so we can revert back to it later.
var previousTitle = $(document).prop("title");

$(window).on('popstate', function(e) {
var params = getQueryStringParams();
// When browsing back from search results the main page
Expand All @@ -709,6 +712,9 @@
$('#main.content').removeClass('hidden');
$('#search.content').addClass('hidden');
}
// Revert to the previous title manually since the History
// API ignores the title parameter.
$(document).prop("title", previousTitle);
// When browsing forward to search results the previous
// search will be repeated, so the currentResults are
// cleared to ensure the search is successful.
Expand Down

0 comments on commit c9e6d9a

Please sign in to comment.