scroll: fix percent-based scrolling
authorPatrick Steinhardt <ps@pks.im>
Sat, 20 May 2017 15:35:44 +0000 (17:35 +0200)
committerPatrick Steinhardt <ps@pks.im>
Sat, 20 May 2017 15:35:44 +0000 (17:35 +0200)
commit1304b8cfc8408c005b37c0416013ed2148519cba
tree14a05fa1242e2c959a89b030141c6dc19462bd09
parent6ff33e957e309f916a39ccb7af49e797125f01e0
scroll: fix percent-based scrolling

Scrolling via ^D and ^U should scroll by a percentage of the client's
current viewport. We do this in JavaScript via the client height of the
document's element. Accidentally, it may hold the desired value in some
cases, but in general it only holds the total height of the element
itself. What we desire instead is the window's height, which can be
retrieved via `Window.innerHeight`. Like this, our calculations are not
based upon the webpage but instead on the browser window, fixing
scrolling on some pages.
src/scripts/scroll.js