From 72a534f42b85b473028b9eabd7b62b3c2d47bf5b Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Thu, 29 Jun 2017 12:15:06 +0300 Subject: [PATCH] Correctly calculate scroll when loading more history --- client/js/socket-events/more.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/js/socket-events/more.js b/client/js/socket-events/more.js index 02ef52f0..b1c4ac0b 100644 --- a/client/js/socket-events/more.js +++ b/client/js/socket-events/more.js @@ -12,7 +12,7 @@ socket.on("more", function(data) { // get the scrollable wrapper around messages const scrollable = chan.closest(".chat"); - const heightOld = chan.height(); + const heightOld = chan.height() - scrollable.scrollTop(); // If there are no more messages to show, just hide the button and do nothing else if (!data.messages.length) {