Merge pull request #865 from marcelklehr/fix/chat-autoscroll
Don't scroll chat automatically if user is not at the bottom
This commit is contained in:
commit
8882bbff6a
|
@ -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() || 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -168,10 +168,6 @@
|
||||||
<input type="checkbox" id="options-linenoscheck" checked>
|
<input type="checkbox" id="options-linenoscheck" checked>
|
||||||
<label for="options-linenoscheck">Line numbers</label>
|
<label for="options-linenoscheck">Line numbers</label>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
|
||||||
<input type="checkbox" id="options-scrollchat" checked>
|
|
||||||
<label for="options-scrollchat">Automatically Scroll Chat</label>
|
|
||||||
</p>
|
|
||||||
<p>
|
<p>
|
||||||
Font type:
|
Font type:
|
||||||
<select id="viewfontmenu">
|
<select id="viewfontmenu">
|
||||||
|
|
Loading…
Reference in New Issue