File tree 1 file changed +10
-5
lines changed
src/librustdoc/html/static
1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 52
52
var start = elemClass . indexOf ( className ) ;
53
53
if ( start == - 1 ) {
54
54
return false ;
55
- } else if ( elemClass . length == className . length ) {
55
+ } else if ( elemClass . length === className . length ) {
56
56
return true ;
57
57
} else {
58
- if ( start > 0 && elemClass [ start - 1 ] != ' ' ) {
58
+ if ( start > 0 && elemClass [ start - 1 ] !== ' ' ) {
59
59
return false ;
60
60
}
61
61
var end = start + className . length ;
62
- if ( end < elemClass . length && elemClass [ end ] != ' ' ) {
62
+ if ( end < elemClass . length && elemClass [ end ] !== ' ' ) {
63
63
return false ;
64
64
}
65
65
return true ;
151
151
removeClass ( document . getElementById ( "main" ) , "hidden" ) ;
152
152
var hash = ev . newURL . slice ( ev . newURL . indexOf ( '#' ) + 1 ) ;
153
153
if ( browserSupportsHistoryApi ( ) ) {
154
- history . replaceState ( hash , "" , "#" + hash ) ;
154
+ history . replaceState ( hash , "" , "?search= #" + hash ) ;
155
155
}
156
156
var elem = document . getElementById ( hash ) ;
157
157
if ( elem ) {
1568
1568
1569
1569
if ( search_input ) {
1570
1570
search_input . onfocus = function ( ) {
1571
- if ( search . value !== "" ) {
1571
+ if ( search_input . value !== "" ) {
1572
1572
addClass ( document . getElementById ( "main" ) , "hidden" ) ;
1573
1573
removeClass ( document . getElementById ( "search" ) , "hidden" ) ;
1574
+ if ( browserSupportsHistoryApi ( ) ) {
1575
+ history . replaceState ( search_input . value ,
1576
+ "" ,
1577
+ "?search=" + encodeURIComponent ( search_input . value ) ) ;
1578
+ }
1574
1579
}
1575
1580
} ;
1576
1581
}
You can’t perform that action at this time.
0 commit comments