don't scroll when users join.
modified: templates/chat.html
This commit is contained in:
parent
2b7999a857
commit
9c3bbe169f
1 changed files with 7 additions and 1 deletions
|
|
@ -308,7 +308,9 @@ socket.on("message", (data) => {
|
|||
});
|
||||
|
||||
// Scroll to the bottom of the chat container
|
||||
document.getElementById("chat").scrollTop = document.getElementById("chat").scrollHeight;
|
||||
if (data.id) {
|
||||
document.getElementById("chat").scrollTop = document.getElementById("chat").scrollHeight;
|
||||
}
|
||||
});
|
||||
|
||||
// Socket event for receiving previous messages
|
||||
|
|
@ -355,6 +357,10 @@ socket.on("previous_messages", (data) => {
|
|||
hljs.highlightElement(block);
|
||||
addLineNumbers(block);
|
||||
});
|
||||
|
||||
// Scroll to the bottom of the chat container
|
||||
document.getElementById("chat").scrollTop = document.getElementById("chat").scrollHeight;
|
||||
|
||||
});
|
||||
|
||||
// Socket event for deleting a processing message
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue