File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
src/librustdoc/html/static Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 943943 if ( hasClass ( main , 'content' ) ) {
944944 removeClass ( main , 'hidden' ) ;
945945 }
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' ) ;
949949 }
950950 }
951951 // Revert to the previous title manually since the History
959959 // perform the search. This will empty the bar if there's
960960 // nothing there, which lets you really go back to a
961961 // 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+ }
963967 // Some browsers fire 'onpopstate' for every page load
964968 // (Chrome), while others fire the event only when actually
965969 // popping a state (Firefox), which is why search() is
You can’t perform that action at this time.
0 commit comments