Correctly calculate scroll when loading more history

This commit is contained in:
Pavel Djundik 2017-06-29 12:15:06 +03:00 committed by Jérémie Astori
parent 08fbcd4958
commit 72a534f42b
No known key found for this signature in database
GPG Key ID: B9A4F245CD67BDE8

View File

@ -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) {