From a5625ba2033520aa53978a0e2a9fb8228dda3c26 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Thu, 12 Jul 2018 13:59:03 +0300 Subject: [PATCH] Remove scroll code from `more` event --- client/js/socket-events/more.js | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/client/js/socket-events/more.js b/client/js/socket-events/more.js index 6918610a..8f6fe966 100644 --- a/client/js/socket-events/more.js +++ b/client/js/socket-events/more.js @@ -1,17 +1,9 @@ "use strict"; -const $ = require("jquery"); const socket = require("../socket"); -const {vueApp, findChannel} = require("../vue"); +const {findChannel} = require("../vue"); socket.on("more", function(data) { - let chan = $("#chat #chan-" + data.chan); - chan = chan.find(".messages"); - - // get the scrollable wrapper around messages - const scrollable = chan.closest(".chat"); - const heightOld = chan.height() - scrollable.scrollTop(); - const channel = findChannel(data.chan); if (!channel) { @@ -21,10 +13,4 @@ socket.on("more", function(data) { channel.channel.moreHistoryAvailable = data.moreHistoryAvailable; channel.channel.messages.unshift(...data.messages); channel.channel.historyLoading = false; - - vueApp.$nextTick(() => { - // restore scroll position - const position = chan.height() - heightOld; - scrollable.finish().scrollTop(position); - }); });