From 2150761fa2c29978d117ad4c55a61afebd884f2b Mon Sep 17 00:00:00 2001 From: Maciej Winnicki Date: Mon, 26 Aug 2019 20:14:30 +0200 Subject: [PATCH] Fix auto-scrolling (#180) --- web/assets/app.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/web/assets/app.js b/web/assets/app.js index a4d9047..a93e7c8 100644 --- a/web/assets/app.js +++ b/web/assets/app.js @@ -133,17 +133,6 @@ window.App = (function app(window, document) { window.history.replaceState(null, document.title, _url.toString()); }; - /** - * @return {Boolean} - * @private - */ - var _isScrolledBottom = function() { - var currentScroll = document.documentElement.scrollTop || document.body.scrollTop; - var totalHeight = document.body.offsetHeight; - var clientHeight = document.documentElement.clientHeight; // eslint-disable-line - return totalHeight <= currentScroll + clientHeight; - }; - /** * @return void * @private @@ -278,7 +267,7 @@ window.App = (function app(window, document) { * @param {string} data data to log */ log: function log(data) { - var wasScrolledBottom = _isScrolledBottom(); + var wasScrolledBottom = window.innerHeight + window.scrollY >= document.body.offsetHeight; var div = document.createElement('div'); var p = document.createElement('p'); p.className = 'inner-line';