File tree 1 file changed +8
-4
lines changed
src/librustdoc/html/static
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 943
943
if ( hasClass ( main , 'content' ) ) {
944
944
removeClass ( main , 'hidden' ) ;
945
945
}
946
- var search = document . getElementById ( 'search' ) ;
947
- if ( hasClass ( main , 'content' ) ) {
948
- addClass ( main , 'hidden' ) ;
946
+ var search_c = document . getElementById ( 'search' ) ;
947
+ if ( hasClass ( search_c , 'content' ) ) {
948
+ addClass ( search_c , 'hidden' ) ;
949
949
}
950
950
}
951
951
// Revert to the previous title manually since the History
959
959
// perform the search. This will empty the bar if there's
960
960
// nothing there, which lets you really go back to a
961
961
// previous state with nothing in the bar.
962
- document . getElementsByClassName ( 'search-input' ) [ 0 ] . value = params . search ;
962
+ if ( params . search ) {
963
+ document . getElementsByClassName ( 'search-input' ) [ 0 ] . value = params . search ;
964
+ } else {
965
+ document . getElementsByClassName ( 'search-input' ) [ 0 ] . value = '' ;
966
+ }
963
967
// Some browsers fire 'onpopstate' for every page load
964
968
// (Chrome), while others fire the event only when actually
965
969
// popping a state (Firefox), which is why search() is
You can’t perform that action at this time.
0 commit comments