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 740740 $ ( ".search-input" ) . on ( "keyup input" , function ( ) {
741741 clearTimeout ( searchTimeout ) ;
742742 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+ }
744748 $ ( '#main.content' ) . removeClass ( 'hidden' ) ;
745749 $ ( '#search.content' ) . addClass ( 'hidden' ) ;
746750 } else {
9961000 var prev_id = 0 ;
9971001
9981002 function set_fragment ( name ) {
999- if ( history . replaceState ) {
1003+ if ( browserSupportsHistoryApi ( ) ) {
10001004 history . replaceState ( null , null , '#' + name ) ;
10011005 $ ( window ) . trigger ( 'hashchange' ) ;
10021006 } else {
You can’t perform that action at this time.
0 commit comments