@@ -149,7 +149,7 @@ function createSourceSidebar() {
149
149
150
150
var lineNumbersRegex = / ^ # ? ( \d + ) (?: - ( \d + ) ) ? $ / ;
151
151
152
- function highlightSourceLines ( scrollTo , match ) {
152
+ function highlightSourceLines ( match ) {
153
153
if ( typeof match === "undefined" ) {
154
154
match = window . location . hash . match ( lineNumbersRegex ) ;
155
155
}
@@ -170,11 +170,9 @@ function highlightSourceLines(scrollTo, match) {
170
170
if ( ! elem ) {
171
171
return ;
172
172
}
173
- if ( scrollTo ) {
174
- var x = document . getElementById ( from ) ;
175
- if ( x ) {
176
- x . scrollIntoView ( ) ;
177
- }
173
+ var x = document . getElementById ( from ) ;
174
+ if ( x ) {
175
+ x . scrollIntoView ( ) ;
178
176
}
179
177
onEachLazy ( document . getElementsByClassName ( "line-numbers" ) , function ( e ) {
180
178
onEachLazy ( e . getElementsByTagName ( "span" ) , function ( i_e ) {
@@ -198,7 +196,7 @@ var handleSourceHighlight = (function() {
198
196
y = window . scrollY ;
199
197
if ( searchState . browserSupportsHistoryApi ( ) ) {
200
198
history . replaceState ( null , null , "#" + name ) ;
201
- highlightSourceLines ( true ) ;
199
+ highlightSourceLines ( ) ;
202
200
} else {
203
201
location . replace ( "#" + name ) ;
204
202
}
@@ -230,15 +228,15 @@ var handleSourceHighlight = (function() {
230
228
window . addEventListener ( "hashchange" , function ( ) {
231
229
var match = window . location . hash . match ( lineNumbersRegex ) ;
232
230
if ( match ) {
233
- return highlightSourceLines ( false , match ) ;
231
+ return highlightSourceLines ( match ) ;
234
232
}
235
233
} ) ;
236
234
237
235
onEachLazy ( document . getElementsByClassName ( "line-numbers" ) , function ( el ) {
238
236
el . addEventListener ( "click" , handleSourceHighlight ) ;
239
237
} ) ;
240
238
241
- highlightSourceLines ( true ) ;
239
+ highlightSourceLines ( ) ;
242
240
243
241
window . createSourceSidebar = createSourceSidebar ;
244
242
} ) ( ) ;
0 commit comments