Mercurial Hosting > chat
diff src/chat.js @ 81:a0d3477d5694
minor
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 10 Mar 2025 22:27:23 -0600 |
parents | b5a316575e64 |
children | a47036fd0158 |
line wrap: on
line diff
--- a/src/chat.js Mon Mar 10 21:54:46 2025 -0600 +++ b/src/chat.js Mon Mar 10 22:27:23 2025 -0600 @@ -419,6 +419,10 @@ //console.log('readUpTo'); let html = `<div user="${userId}" unread="${unread}">read by ${userNameHtml}</div>`; div.insertAdjacentHTML('beforeend',html); + if( !old ) { + let dy = document.querySelector('div[unread]').clientHeight; + document.querySelector('div[main]').scrollBy(0,dy); + } } function replyPost(el) {