fix scroll after attachment cancel

This commit is contained in:
Martti Malmi 2020-05-19 10:10:59 +03:00
parent 058cfb0ac7
commit 76e5c9a7ee

View File

@ -63,6 +63,10 @@ $(window).load(() => {
$('body').css('opacity', 1); // use opacity because setting focus on display: none elements fails
});
var scrollToMessageListBottom = _.throttle(() => {
$('#message-view').scrollTop($('#message-view')[0].scrollHeight - $('#message-view')[0].clientHeight);
}, 100, true);
$('#login').hide();
var localStorageKey = localStorage.getItem('chatKeyPair');
if (localStorageKey) {
@ -417,6 +421,7 @@ function closeAttachmentsPreview() {
if (activeChat) {
chats[activeChat].attachments = null;
}
scrollToMessageListBottom();
}
function closeAttachmentsGallery() {
@ -1233,10 +1238,6 @@ var askForPeers = _.once(pub => {
});
});
var scrollToMessageListBottom = _.throttle(() => {
$('#message-view').scrollTop($('#message-view')[0].scrollHeight - $('#message-view')[0].clientHeight);
}, 100, true);
function addChat(channel) {
var pub = channel.getId();
if (chats[pub]) { return; }