Skip to content

Commit

Permalink
restore the page title after escaping out of a search
Browse files Browse the repository at this point in the history
  • Loading branch information
oconnor663 committed Aug 16, 2018
1 parent d767ee1 commit 2075509
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/librustdoc/html/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@

var themesWidth = null;

var titleBeforeSearch = document.title;

if (!String.prototype.startsWith) {
String.prototype.startsWith = function(searchString, position) {
position = position || 0;
Expand Down Expand Up @@ -267,6 +269,7 @@
ev.preventDefault();
addClass(search, "hidden");
removeClass(document.getElementById("main"), "hidden");
document.title = titleBeforeSearch;
}
defocusSearchBar();
}
Expand Down

0 comments on commit 2075509

Please sign in to comment.