1
Fork 0

restore the page title after escaping out of a search

This commit is contained in:
Jack O'Connor 2018-08-15 14:08:25 -04:00
commit 207550981f

View file

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