mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-25 21:58:41 +00:00
feat(user_msg): auto scroll to bottom after enter or send msg
This commit is contained in:
parent
99e9a839af
commit
d6ac737a11
@ -150,7 +150,7 @@ if (isset($_POST['user_msg'])) {
|
|||||||
<button id="goBack" class="btn-close position-absolute" aria-label="关闭对话"></button>
|
<button id="goBack" class="btn-close position-absolute" aria-label="关闭对话"></button>
|
||||||
<div id="conversation-name" class="text-center"></div>
|
<div id="conversation-name" class="text-center"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body overflow-auto">
|
<div class="card-body overflow-auto" id="history-list-container">
|
||||||
<div id="history-list" style="min-height: 200px;"></div>
|
<div id="history-list" style="min-height: 200px;"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-footer bg-transparent">
|
<div class="card-footer bg-transparent">
|
||||||
@ -376,6 +376,7 @@ if (isset($_POST['user_msg'])) {
|
|||||||
}, REFRESH_INTERVAL);
|
}, REFRESH_INTERVAL);
|
||||||
$('#history').show();
|
$('#history').show();
|
||||||
$('#conversations').addClass('d-none d-md-block')
|
$('#conversations').addClass('d-none d-md-block')
|
||||||
|
$("#history-list-container").scrollTop($("#history-list").height());
|
||||||
$('#input-message').unbind('keydown').keydown(function(e) {
|
$('#input-message').unbind('keydown').keydown(function(e) {
|
||||||
if (e.keyCode == 13 && e.ctrlKey) {
|
if (e.keyCode == 13 && e.ctrlKey) {
|
||||||
$('#message-submit').click();
|
$('#message-submit').click();
|
||||||
@ -386,6 +387,7 @@ if (isset($_POST['user_msg'])) {
|
|||||||
page = 1;
|
page = 1;
|
||||||
changeAble = refreshHistory(conversationName, page);
|
changeAble = refreshHistory(conversationName, page);
|
||||||
refreshConversations();
|
refreshConversations();
|
||||||
|
$("#history-list-container").scrollTop($("#history-list").height());
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
$('#goBack').unbind("click").click(function() {
|
$('#goBack').unbind("click").click(function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user