]> git.lizzy.rs Git - rust.git/commitdiff
restore the page title after escaping out of a search
authorJack O'Connor <oconnor663@gmail.com>
Wed, 15 Aug 2018 18:08:25 +0000 (14:08 -0400)
committerJack O'Connor <oconnor663@gmail.com>
Thu, 16 Aug 2018 03:05:52 +0000 (23:05 -0400)
src/librustdoc/html/static/main.js

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