File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/librustdoc/html/static Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -935,6 +935,9 @@ window.initSearch = function(rawSearchIndex) {
935935 } ) ;
936936 current += 1 ;
937937 } ) ;
938+ var SHIFT = 16 ;
939+ var CTRL = 17 ;
940+ var ALT = 18 ;
938941
939942 var currentTab = searchState . currentTab ;
940943 if ( e . which === 38 ) { // up
@@ -967,10 +970,10 @@ window.initSearch = function(rawSearchIndex) {
967970 e . preventDefault ( ) ;
968971 } else if ( e . which === 13 ) { // return
969972 if ( actives [ currentTab ] . length ) {
970- document . location . href =
971- actives [ currentTab ] [ 0 ] . getElementsByTagName ( "a" ) [ 0 ] . href ;
973+ var elem = actives [ currentTab ] [ 0 ] . getElementsByTagName ( "a" ) [ 0 ] ;
974+ document . location . href = elem . href ;
972975 }
973- } else if ( e . which === 16 ) { // shift
976+ } else if ( [ SHIFT , CTRL , ALT ] . indexOf ( e . which ) !== - 1 ) {
974977 // Does nothing, it's just to avoid losing "focus" on the highlighted element.
975978 } else if ( actives [ currentTab ] . length > 0 ) {
976979 removeClass ( actives [ currentTab ] [ 0 ] , "highlighted" ) ;
You can’t perform that action at this time.
0 commit comments