diff --git a/public/src/client/chats.js b/public/src/client/chats.js index 997092b53e..bbc9810226 100644 --- a/public/src/client/chats.js +++ b/public/src/client/chats.js @@ -266,7 +266,7 @@ define('forum/chats', [ }; Chats.addScrollBottomHandler = function (chatContent) { - chatContent.parent() + chatContent.parents('[component="chat/message/window"]') .find('[component="chat/messages/scroll-up-alert"]') .off('click').on('click', function () { messages.scrollToBottom(chatContent); diff --git a/public/src/client/chats/messages.js b/public/src/client/chats/messages.js index f8adbeae5e..dd6476990b 100644 --- a/public/src/client/chats/messages.js +++ b/public/src/client/chats/messages.js @@ -149,7 +149,7 @@ define('forum/chats/messages', [ messages.scrollToBottom = function (containerEl) { if (containerEl && containerEl.length) { containerEl.scrollTop(containerEl[0].scrollHeight - containerEl.height()); - containerEl.parent() + containerEl.parents('[component="chat/message/window"]') .find('[component="chat/messages/scroll-up-alert"]') .addClass('hidden'); } @@ -163,7 +163,7 @@ define('forum/chats/messages', [ messages.toggleScrollUpAlert = function (containerEl) { const isAtBottom = messages.isAtBottom(containerEl, 300); - containerEl.parent() + containerEl.parents('[component="chat/message/window"]') .find('[component="chat/messages/scroll-up-alert"]') .toggleClass('hidden', isAtBottom); };