]> git.proxmox.com Git - rustc.git/blobdiff - src/librustdoc/html/static/main.js
Imported Upstream version 1.9.0+dfsg1
[rustc.git] / src / librustdoc / html / static / main.js
index f3efbcb1db3080f107e3fe7ca3250a810bf71b14..1d1e78926f1208c7eec107e24e651c7da5fb12a2 100644 (file)
             $(".search-input").on("keyup input",function() {
                 clearTimeout(searchTimeout);
                 if ($(this).val().length === 0) {
-                    window.history.replaceState("", "std - Rust", "?search=");
+                    if (browserSupportsHistoryApi()) {
+                        history.replaceState("", "std - Rust", "?search=");
+                    }
                     $('#main.content').removeClass('hidden');
                     $('#search.content').addClass('hidden');
                 } else {
         var prev_id = 0;
 
         function set_fragment(name) {
-            if (history.replaceState) {
+            if (browserSupportsHistoryApi()) {
                 history.replaceState(null, null, '#' + name);
                 $(window).trigger('hashchange');
             } else {