File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change 190
190
return false ;
191
191
}
192
192
193
+ // Sometimes it's possible to trigger focus on first link with some keyboard action.
194
+ // Browser in such a case tries to scroll the page to make this element visible
195
+ // (even that body overflow is set to hidden) and it breaks our careful positioning.
196
+ //
197
+ // So, as a lousy (and lazy) workaround we will make the page scroll back to the top
198
+ // whenever slide is selected
199
+ //
200
+ // If you are reading this and know any better way to handle it, I'll be glad to hear about it!
201
+ window . scrollTo ( 0 , 0 ) ;
202
+
193
203
var step = el . stepData ;
194
204
195
205
if ( $ ( ".step.active" , impress ) ) {
296
306
select ( getElementFromUrl ( ) ) ;
297
307
} , false ) ;
298
308
299
- // Sometimes it's possible to trigger focus on first link with some keyboard action.
300
- // Browser in such a case tries to scroll the page to make this element visible
301
- // (even that body overflow is set to hidden) and it breaks our careful positioning.
302
- //
303
- // So, as a lousy (and lazy) workaround any scroll event will make the page scroll back to the top.
304
- //
305
- // If you are reading this and know any better way to handle it, I'll be glad to hear about it!
306
- window . addEventListener ( "scroll" , function ( event ) {
307
- window . scrollTo ( 0 , 0 ) ;
308
- } , false ) ;
309
-
310
309
// START
311
310
// by selecting step defined in url or first step of the presentation
312
311
select ( getElementFromUrl ( ) || steps [ 0 ] ) ;
You can’t perform that action at this time.
0 commit comments