File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
src/librustdoc/html/static Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 150
150
addClass ( search , "hidden" ) ;
151
151
removeClass ( document . getElementById ( "main" ) , "hidden" ) ;
152
152
var hash = ev . newURL . slice ( ev . newURL . indexOf ( '#' ) + 1 ) ;
153
+ if ( browserSupportsHistoryApi ( ) ) {
154
+ history . replaceState ( hash , "" , "#" + hash ) ;
155
+ }
153
156
var elem = document . getElementById ( hash ) ;
154
157
if ( elem ) {
155
158
elem . scrollIntoView ( ) ;
1560
1563
} ) ;
1561
1564
}
1562
1565
} ) ;
1566
+
1567
+ var search_input = document . getElementsByClassName ( "search-input" ) [ 0 ] ;
1568
+
1569
+ if ( search_input ) {
1570
+ search_input . onfocus = function ( ) {
1571
+ if ( search . value !== "" ) {
1572
+ addClass ( document . getElementById ( "main" ) , "hidden" ) ;
1573
+ removeClass ( document . getElementById ( "search" ) , "hidden" ) ;
1574
+ }
1575
+ } ;
1576
+ }
1563
1577
} ( ) ) ;
1564
1578
1565
1579
// Sets the focus on the search bar at the top of the page
You can’t perform that action at this time.
0 commit comments