Skip to content

Commit

Permalink
✨ Add option to scroll message into view
Browse files Browse the repository at this point in the history
  • Loading branch information
haliphax committed Jun 12, 2023
1 parent e4a1478 commit bc7851c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion html/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,14 @@ setInterval(

store.messages.splice(0, idx < 0 ? store.messages.length : idx);
},
constants.CLEANUP_TIMER);
constants.CLEANUP_TIMER
);

new Vue({ el: 'body > div:first-child' });

if (hs.scroll) {
const messages = document.querySelector('.messages');
const opts = { behavior: "smooth", block: "end", inline: "start" };

setInterval(() => { messages.scrollIntoView(opts) }, 100);
}

0 comments on commit bc7851c

Please sign in to comment.