Fix #581 Don't scroll chat automatically if user is not at the bottom

pull/865/head
Marcel Klehr 2012-07-11 22:30:03 +02:00
parent 6726ea6632
commit 8a471e590a
1 changed files with 3 additions and 2 deletions

View File

@ -62,9 +62,10 @@ var chat = (function()
},
scrollDown: function()
{
if($('#options-scrollchat').is(':checked')){
if($('#chatbox').css("display") != "none"){
if(!self.lastMessage || self.lastMessage.position().top < $('#chattext').height()) {
$('#chattext').animate({scrollTop: $('#chattext')[0].scrollHeight}, "slow");
self.lastMessage = $('#chattext > p').eq(-1);
}
}
},