mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Better VN mode autoscrolling
This commit is contained in:
@@ -1378,8 +1378,18 @@ function formatGenerationTimer(gen_started, gen_finished) {
|
||||
|
||||
function scrollChatToBottom() {
|
||||
if (power_user.auto_scroll_chat_to_bottom) {
|
||||
var $textchat = $("#chat");
|
||||
$textchat.scrollTop(($textchat[0].scrollHeight));
|
||||
const chatElement = $("#chat");
|
||||
let position = chatElement[0].scrollHeight;
|
||||
|
||||
if (power_user.waifuMode) {
|
||||
const lastMessage = chatElement.find('.mes').last();
|
||||
if (lastMessage.length) {
|
||||
const lastMessagePosition = lastMessage.position().top;
|
||||
position = chatElement.scrollTop() + lastMessagePosition;
|
||||
}
|
||||
}
|
||||
|
||||
chatElement.scrollTop(position);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user