mirror of
https://github.com/thelounge/thelounge
synced 2024-11-26 05:50:22 +00:00
Fix scrolling issue
This commit is contained in:
parent
629592d641
commit
838eca8fe5
1 changed files with 7 additions and 1 deletions
|
@ -38,7 +38,13 @@ socket.on("more", function(data) {
|
|||
|
||||
// restore scroll position
|
||||
const position = chan.height() - heightOld;
|
||||
scrollable.scrollTop(position);
|
||||
scrollable.finish().scrollTop(position);
|
||||
|
||||
// We have to do this hack due to smooth scrolling in browsers,
|
||||
// as scrollTop does not apply correctly
|
||||
if (window.requestAnimationFrame) {
|
||||
window.requestAnimationFrame(() => scrollable.scrollTop(position));
|
||||
}
|
||||
|
||||
if (data.messages.length !== 100) {
|
||||
scrollable.find(".show-more").removeClass("show");
|
||||
|
|
Loading…
Reference in a new issue