mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
Fix #581 Don't scroll chat automatically if user is not at the bottom
This commit is contained in:
parent
6726ea6632
commit
8a471e590a
1 changed files with 3 additions and 2 deletions
|
@ -62,9 +62,10 @@ var chat = (function()
|
||||||
},
|
},
|
||||||
scrollDown: function()
|
scrollDown: function()
|
||||||
{
|
{
|
||||||
if($('#options-scrollchat').is(':checked')){
|
|
||||||
if($('#chatbox').css("display") != "none"){
|
if($('#chatbox').css("display") != "none"){
|
||||||
|
if(!self.lastMessage || self.lastMessage.position().top < $('#chattext').height()) {
|
||||||
$('#chattext').animate({scrollTop: $('#chattext')[0].scrollHeight}, "slow");
|
$('#chattext').animate({scrollTop: $('#chattext')[0].scrollHeight}, "slow");
|
||||||
|
self.lastMessage = $('#chattext > p').eq(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue