Fix page scroll glitch

This commit is contained in:
Jérémie Astori 2017-04-02 21:03:01 -04:00
parent 2d9aa35c06
commit 09eaf80f8c

View File

@ -808,7 +808,7 @@ $(function() {
var input = $("#input") var input = $("#input")
.history() .history()
.on("input keyup", function() { .on("input", function() {
var style = window.getComputedStyle(this); var style = window.getComputedStyle(this);
// Start by resetting height before computing as scrollHeight does not // Start by resetting height before computing as scrollHeight does not
@ -1312,13 +1312,13 @@ $(function() {
container = container.find(".chan.active .chat"); container = container.find(".chan.active .chat");
} }
const offset = container.get(0).clientHeight * 0.94; const offset = container.get(0).clientHeight * 0.9;
let scrollTop = container.scrollTop(); let scrollTop = container.scrollTop();
if (key === "pageup") { if (key === "pageup") {
scrollTop -= offset; scrollTop = Math.floor(scrollTop - offset);
} else { } else {
scrollTop += offset; scrollTop = Math.ceil(scrollTop + offset);
} }
container.stop().animate({ container.stop().animate({