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,11 +27,12 @@ function main() {
2727 return
2828 }
2929
30- // layout
30+ // setup the layout
3131 configureFileSelect ( )
3232 addIncrementalButton ( )
3333 addThemeButton ( )
3434
35+ // setup the content
3536 configureCodeBlocks ( )
3637 configureSyntaxHighlight ( 'pre .code .editor' )
3738 addCoverageSpans ( 'pre .coverage .editor' )
@@ -113,16 +114,11 @@ function configureFileSelect() {
113114 }
114115
115116 document . location . hash = e . target . value
116- document . querySelectorAll ( '.file' ) . forEach ( ( el ) => ( el . style . display = 'none' ) )
117- el . style . display = 'block'
118117
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 ;
124119
125- scrollUp ( 1 )
120+ document . querySelectorAll ( '.file' ) . forEach ( ( el ) => ( el . style . display = 'none' ) )
121+ el . style . display = 'block'
126122 } )
127123
128124 files . value = selected
You can’t perform that action at this time.
0 commit comments