Ensure scrolling action works when jumping in ToC list

Former-commit-id: 6415494c22071c7ed990fdbcbf44274f79b76488 [formerly 81c1ba511ccbc8605987d64cf0db596f6dbf34a2]
Former-commit-id: 1f5df33782ff5a484277c3acd850fd46a81b8f30
This commit is contained in:
Jaifroid 2020-01-23 22:31:58 +00:00
parent 29f3a1bbfd
commit f8f0f6b3bd

View File

@ -3414,7 +3414,10 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'utf8', 'images', 'cooki
listElement.addEventListener('click', function () { listElement.addEventListener('click', function () {
var iframeWin = document.getElementById('articleContent').contentWindow; var iframeWin = document.getElementById('articleContent').contentWindow;
iframeWin.location.hash = this.dataset.headingId; iframeWin.location.hash = this.dataset.headingId;
iframeWin.onscroll(); iframeWin.scrollBy(0, -5);
setTimeout(function () {
iframeWin.scrollBy(0, 5);
}, 250);
}); });
}); });
} }