summaryrefslogtreecommitdiffstats
path: root/target/doc/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'target/doc/main.js')
-rw-r--r--target/doc/main.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/target/doc/main.js b/target/doc/main.js
index f3efbcb..1d1e789 100644
--- a/target/doc/main.js
+++ b/target/doc/main.js
@@ -740,7 +740,9 @@
$(".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 {
@@ -996,7 +998,7 @@
var prev_id = 0;
function set_fragment(name) {
- if (history.replaceState) {
+ if (browserSupportsHistoryApi()) {
history.replaceState(null, null, '#' + name);
$(window).trigger('hashchange');
} else {