File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
src/librustdoc/html/static Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 122
122
}
123
123
124
124
function highlightSourceLines ( ev ) {
125
+ var search = document . getElementById ( "search" ) ;
125
126
var i , from , to , match = window . location . hash . match ( / ^ # ? ( \d + ) (?: - ( \d + ) ) ? $ / ) ;
126
127
if ( match ) {
127
128
from = parseInt ( match [ 1 ] , 10 ) ;
145
146
for ( i = from ; i <= to ; ++ i ) {
146
147
addClass ( document . getElementById ( i ) , 'line-highlighted' ) ;
147
148
}
149
+ } else if ( ev !== null && search && ! hasClass ( search , "hidden" ) && ev . newURL ) {
150
+ addClass ( search , "hidden" ) ;
151
+ removeClass ( document . getElementById ( "main" ) , "hidden" ) ;
152
+ var hash = ev . newURL . slice ( ev . newURL . indexOf ( '#' ) + 1 ) ;
153
+ var elem = document . getElementById ( hash ) ;
154
+ if ( elem ) {
155
+ elem . scrollIntoView ( ) ;
156
+ }
148
157
}
149
158
}
150
159
highlightSourceLines ( null ) ;
You can’t perform that action at this time.
0 commit comments