File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/librustdoc/html/static Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 740
740
$ ( ".search-input" ) . on ( "keyup input" , function ( ) {
741
741
clearTimeout ( searchTimeout ) ;
742
742
if ( $ ( this ) . val ( ) . length === 0 ) {
743
- window . history . replaceState ( "" , "std - Rust" , "?search=" ) ;
743
+ if ( browserSupportsHistoryApi ( ) ) {
744
+ history . replaceState ( "" , "std - Rust" , "?search=" ) ;
745
+ } else {
746
+ location . replace ( "?search=" ) ;
747
+ }
744
748
$ ( '#main.content' ) . removeClass ( 'hidden' ) ;
745
749
$ ( '#search.content' ) . addClass ( 'hidden' ) ;
746
750
} else {
996
1000
var prev_id = 0 ;
997
1001
998
1002
function set_fragment ( name ) {
999
- if ( history . replaceState ) {
1003
+ if ( browserSupportsHistoryApi ( ) ) {
1000
1004
history . replaceState ( null , null , '#' + name ) ;
1001
1005
$ ( window ) . trigger ( 'hashchange' ) ;
1002
1006
} else {
You can’t perform that action at this time.
0 commit comments