From 818a21b52e4c57019a9680cdd0e595409b41751c Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Tue, 4 Jul 2017 20:51:22 +0300 Subject: [PATCH] Fix jumps when toggling link preview --- client/js/socket-events/msg_preview.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/js/socket-events/msg_preview.js b/client/js/socket-events/msg_preview.js index 8760ce0c..7f90784d 100644 --- a/client/js/socket-events/msg_preview.js +++ b/client/js/socket-events/msg_preview.js @@ -9,7 +9,7 @@ socket.on("msg:preview", function(data) { data.preview.shown = options.shouldOpenMessagePreview(data.preview.type); const msg = $("#msg-" + data.id); - const container = msg.parent(".messages"); + const container = msg.closest(".chat"); const bottom = container.isScrollBottom(); msg.find(".text").append(templates.msg_preview({preview: data.preview})); @@ -23,7 +23,7 @@ socket.on("msg:preview", function(data) { $("#chat").on("click", ".toggle-button", function() { const self = $(this); - const container = self.closest(".messages"); + const container = self.closest(".chat"); const content = self.parent().next(".toggle-content"); const bottom = container.isScrollBottom();