parent
d2cf9f9632
commit
36882a0007
1 changed files with 6 additions and 0 deletions
|
@ -697,6 +697,9 @@
|
||||||
// Push and pop states are used to add search results to the browser
|
// Push and pop states are used to add search results to the browser
|
||||||
// history.
|
// history.
|
||||||
if (browserSupportsHistoryApi()) {
|
if (browserSupportsHistoryApi()) {
|
||||||
|
// Store the previous <title> so we can revert back to it later.
|
||||||
|
var previousTitle = $(document).prop("title");
|
||||||
|
|
||||||
$(window).on('popstate', function(e) {
|
$(window).on('popstate', function(e) {
|
||||||
var params = getQueryStringParams();
|
var params = getQueryStringParams();
|
||||||
// When browsing back from search results the main page
|
// When browsing back from search results the main page
|
||||||
|
@ -705,6 +708,9 @@
|
||||||
$('#main.content').removeClass('hidden');
|
$('#main.content').removeClass('hidden');
|
||||||
$('#search.content').addClass('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
|
// When browsing forward to search results the previous
|
||||||
// search will be repeated, so the currentResults are
|
// search will be repeated, so the currentResults are
|
||||||
// cleared to ensure the search is successful.
|
// cleared to ensure the search is successful.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue