Skip to content

Commit

Permalink
Merge pull request thelounge#1244 from thelounge/xPaw/fix-page-keys
Browse files Browse the repository at this point in the history
Correctly finish scroll animation when using page keys
  • Loading branch information
astorije committed Jun 21, 2017
2 parents fdbcb50 + 5fb25bc commit 9e7ece9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions client/js/lounge.js
Expand Up @@ -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();

Expand All @@ -1324,7 +1323,7 @@ $(function() {
scrollTop = Math.ceil(scrollTop + offset);
}

container.stop().animate({
container.animate({
scrollTop: scrollTop
}, 200);

Expand Down

0 comments on commit 9e7ece9

Please sign in to comment.