Added auto-scrolling to private message panel. Fixed auto-scrolling w/ laggy assets in chat and PM.

This commit is contained in:
rainbow napkin 2025-10-07 03:17:16 -04:00
parent 3d2b40b3c8
commit 4698ba4122
2 changed files with 122 additions and 6 deletions

View file

@ -145,6 +145,12 @@ class chatBox{
*/
this.showChatIcon = document.querySelector("#media-panel-show-chat-icon");
/**
* re-occuring auto-scroll call
* cope for the fact that postprocessedMessage objects in renderMessage aren't throwing load events
*/
this.scrollInterval = setInterval(this.handleAutoScroll.bind(this), 200);
//Setup functions
this.setupInput();
this.defineListeners();
@ -567,11 +573,15 @@ class chatBox{
const bufferHeight = Math.round(bufferRect.height);
const bufferWidth = Math.round(bufferRect.width);
//If last height was unset
if(this.lastHeight == 0){
//Set it based on buffer Height
this.lastHeight = bufferHeight;
}
//if last width is unset
if(this.lastWidth == 0){
//Set it based on buffer width
this.lastWidth = bufferWidth;
}