diff options
author | John McLear <john@mclear.co.uk> | 2015-02-07 23:23:33 +0000 |
---|---|---|
committer | John McLear <john@mclear.co.uk> | 2015-02-07 23:26:02 +0000 |
commit | 1652ed42c508feaa15c4d7f482e57d2ae0d67be7 (patch) | |
tree | 97dd3562303ad92d7352c7db114fc8b9919e6425 | |
parent | b9802616b6cab99a43b470972f62f24fcc21f473 (diff) | |
download | etherpad-lite-1652ed42c508feaa15c4d7f482e57d2ae0d67be7.zip |
fix scroll issue where focus is not well managed
remove console logs
-rw-r--r-- | src/static/js/chat.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/static/js/chat.js b/src/static/js/chat.js index ce9a0033..5040ea59 100644 --- a/src/static/js/chat.js +++ b/src/static/js/chat.js @@ -91,7 +91,9 @@ var chat = (function() { if($('#chatbox').css("display") != "none"){ if(!self.lastMessage || !self.lastMessage.position() || self.lastMessage.position().top < $('#chattext').height()) { - $('#chattext').animate({scrollTop: $('#chattext')[0].scrollHeight}, "slow"); + // if we use a slow animate here we can have a race condition when a users focus can not be moved away + // from the last message recieved. + $('#chattext').animate({scrollTop: $('#chattext')[0].scrollHeight}, "fast"); self.lastMessage = $('#chattext > p').eq(-1); } } |