File tree 1 file changed +5
-9
lines changed
1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -27,11 +27,12 @@ function main() {
27
27
return
28
28
}
29
29
30
- // layout
30
+ // setup the layout
31
31
configureFileSelect ( )
32
32
addIncrementalButton ( )
33
33
addThemeButton ( )
34
34
35
+ // setup the content
35
36
configureCodeBlocks ( )
36
37
configureSyntaxHighlight ( 'pre .code .editor' )
37
38
addCoverageSpans ( 'pre .coverage .editor' )
@@ -113,16 +114,11 @@ function configureFileSelect() {
113
114
}
114
115
115
116
document . location . hash = e . target . value
116
- document . querySelectorAll ( '.file' ) . forEach ( ( el ) => ( el . style . display = 'none' ) )
117
- el . style . display = 'block'
118
117
119
- let scrollUp = ( times ) => {
120
- if ( window . scrollY === 0 && times > 3 ) return
121
- window . scrollTo ( 0 , 0 )
122
- window . requestAnimationFrame ( ( ) => scrollUp ( times + 1 ) )
123
- }
118
+ document . body . scrollTop = 0 ;
124
119
125
- scrollUp ( 1 )
120
+ document . querySelectorAll ( '.file' ) . forEach ( ( el ) => ( el . style . display = 'none' ) )
121
+ el . style . display = 'block'
126
122
} )
127
123
128
124
files . value = selected
You can’t perform that action at this time.
0 commit comments