diff --git a/www/fetchlogfile.php3 b/www/fetchlogfile.php3 index f3db4c2eb68994c76bb0159ee7fcf3f5dfb5028b..7fea1bf29f1344d5dea6384927ed90df4c24c75b 100644 --- a/www/fetchlogfile.php3 +++ b/www/fetchlogfile.php3 @@ -37,11 +37,12 @@ // If the user is scrolled to the bottom, make sure they // stay scrolled to the bottom after appending. - var shouldScroll = ((document.body.scrollHeight > document.body.clientHeight) || (document.body.scrollHeight - document.body.scrollTop === document.body.clientHeight)); + var shouldScroll = (document.body.scrollHeight - window.scrollY === window.innerHeight); + console.log(document.body.scrollHeight, window.scrollY, window.innerHeight); $('pre').append(_.escape(newText)); if (shouldScroll) { - document.body.scrollTop = document.body.scrollHeight; + window.scroll(window.scrollX, document.body.scrollHeight); } } };