From 22eb30bbaed779290fd60b01657fd97f23bd6aba Mon Sep 17 00:00:00 2001 From: Christian 'ketura' McCarty Date: Thu, 8 Sep 2022 21:09:01 -0500 Subject: [PATCH] Fixed chat not scrolling to the bottom at the start of matches --- gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/chat.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/chat.js b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/chat.js index e58494973..7915e12cc 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/chat.js +++ b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/chat.js @@ -334,9 +334,10 @@ var ChatBoxUI = Class.extend({ var locked = false; var scroll = this.chatMessagesDiv.scrollTop(); var maxScroll = this.chatMessagesDiv[0].scrollHeight - this.chatMessagesDiv.outerHeight(); + var noScrollBars = maxScroll <= 0; var ratio = scroll / maxScroll; - if(msgClass === "warningMessage" || ratio >= 0.95) + if(msgClass === "warningMessage" || noScrollBars || maxScroll <= 30 || ratio >= 0.95) locked = true; if(this.pingRegex != null && this.pingRegex.test(message))