From 28528dc86595efaeb0b627703a6379af76babf30 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Tue, 20 Jun 2017 13:22:58 +0300 Subject: [PATCH] Correctly finish scroll animation when using page keys Fixes #1022. --- client/js/lounge.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/client/js/lounge.js b/client/js/lounge.js index 84161f66..9379697b 100644 --- a/client/js/lounge.js +++ b/client/js/lounge.js @@ -1306,15 +1306,14 @@ $(function() { "pagedown" ], function(e, key) { let container = windows.find(".window.active"); - if (container.is(":animated")) { - return; - } // Chat windows scroll message container if (container.attr("id") === "chat-container") { container = container.find(".chan.active .chat"); } + container.finish(); + const offset = container.get(0).clientHeight * 0.9; let scrollTop = container.scrollTop(); @@ -1324,7 +1323,7 @@ $(function() { scrollTop = Math.ceil(scrollTop + offset); } - container.stop().animate({ + container.animate({ scrollTop: scrollTop }, 200);