From 09eaf80f8c824f16999afd3a88f10cf0baa37189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Astori?= Date: Sun, 2 Apr 2017 21:03:01 -0400 Subject: [PATCH] Fix page scroll glitch --- client/js/lounge.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/js/lounge.js b/client/js/lounge.js index a7a67796..00ab4f02 100644 --- a/client/js/lounge.js +++ b/client/js/lounge.js @@ -808,7 +808,7 @@ $(function() { var input = $("#input") .history() - .on("input keyup", function() { + .on("input", function() { var style = window.getComputedStyle(this); // Start by resetting height before computing as scrollHeight does not @@ -1312,13 +1312,13 @@ $(function() { 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(); if (key === "pageup") { - scrollTop -= offset; + scrollTop = Math.floor(scrollTop - offset); } else { - scrollTop += offset; + scrollTop = Math.ceil(scrollTop + offset); } container.stop().animate({