From f8f0f6b3bda000ed84d2564d754e6846f9ed2e37 Mon Sep 17 00:00:00 2001 From: Jaifroid Date: Thu, 23 Jan 2020 22:31:58 +0000 Subject: [PATCH] Ensure scrolling action works when jumping in ToC list Former-commit-id: 6415494c22071c7ed990fdbcbf44274f79b76488 [formerly 81c1ba511ccbc8605987d64cf0db596f6dbf34a2] Former-commit-id: 1f5df33782ff5a484277c3acd850fd46a81b8f30 --- www/js/app.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/www/js/app.js b/www/js/app.js index 43a76d0e..0efce8a7 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -3414,7 +3414,10 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'utf8', 'images', 'cooki listElement.addEventListener('click', function () { var iframeWin = document.getElementById('articleContent').contentWindow; iframeWin.location.hash = this.dataset.headingId; - iframeWin.onscroll(); + iframeWin.scrollBy(0, -5); + setTimeout(function () { + iframeWin.scrollBy(0, 5); + }, 250); }); }); }