Fix scrolling issue
This commit is contained in:
parent
629592d641
commit
838eca8fe5
@ -38,7 +38,13 @@ socket.on("more", function(data) {
|
|||||||
|
|
||||||
// restore scroll position
|
// restore scroll position
|
||||||
const position = chan.height() - heightOld;
|
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) {
|
if (data.messages.length !== 100) {
|
||||||
scrollable.find(".show-more").removeClass("show");
|
scrollable.find(".show-more").removeClass("show");
|
||||||
|
Loading…
Reference in New Issue
Block a user