File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -27,12 +27,13 @@ function main() {
27
27
return
28
28
}
29
29
30
- // layout
30
+ // setup the layout
31
31
configureLegend ( )
32
32
configureFileSelect ( )
33
33
addIncrementalButton ( )
34
34
addThemeButton ( )
35
35
36
+ // setup the content
36
37
configureCodeBlocks ( )
37
38
configureSyntaxHighlight ( 'pre .code .editor' )
38
39
addCoverageSpans ( 'pre .coverage .editor' )
@@ -127,16 +128,11 @@ function configureFileSelect() {
127
128
}
128
129
129
130
document . location . hash = e . target . value
130
- document . querySelectorAll ( '.file' ) . forEach ( ( el ) => ( el . style . display = 'none' ) )
131
- el . style . display = 'block'
132
131
133
- let scrollUp = ( times ) => {
134
- if ( window . scrollY === 0 && times > 3 ) return
135
- window . scrollTo ( 0 , 0 )
136
- window . requestAnimationFrame ( ( ) => scrollUp ( times + 1 ) )
137
- }
132
+ document . body . scrollTop = 0 ;
138
133
139
- scrollUp ( 1 )
134
+ document . querySelectorAll ( '.file' ) . forEach ( ( el ) => ( el . style . display = 'none' ) )
135
+ el . style . display = 'block'
140
136
} )
141
137
142
138
files . value = selected
You can’t perform that action at this time.
0 commit comments