From cc08c9f3dfc9b03a9b45f1ab5fb25d2c3134a6ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Tue, 7 Jun 2022 20:24:53 +0200 Subject: [PATCH] theme: avoid initial scrolling in print #268 --- static/js/theme.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/static/js/theme.js b/static/js/theme.js index 30f801b549..b3ae2f65c0 100644 --- a/static/js/theme.js +++ b/static/js/theme.js @@ -552,6 +552,10 @@ function initToc(){ t.addEventListener( 'click', showToc ); p.addEventListener( 'click', showToc ); } + + // finally give initial focus to allow keyboard scrolling in FF + document.querySelector( '#body-inner' ).focus(); + psc && psc.scrollbarY.focus(); } function initSwipeHandler(){ @@ -768,10 +772,6 @@ jQuery(function() { jQuery('[data-nav-id="' + url + '"]').addClass('visited'); } } - - // finally give initial focus to allow keyboard scrolling in FF - document.querySelector( '#body-inner' ).focus(); - psc && psc.scrollbarY.focus(); }); jQuery.extend({