mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-15 18:26:15 +01:00
re: #5862, setting chat list height even if no message list is present
This commit is contained in:
@@ -375,17 +375,19 @@ define('forum/chats', [
|
|||||||
|
|
||||||
Chats.resizeMainWindow = function () {
|
Chats.resizeMainWindow = function () {
|
||||||
var messagesList = $('.expanded-chat .chat-content');
|
var messagesList = $('.expanded-chat .chat-content');
|
||||||
|
var searchHeight = $('.chat-search').height();
|
||||||
|
var searchListHeight = $('[component="chat/search/list"]').outerHeight(true) - $('[component="chat/search/list"]').height();
|
||||||
|
var fromTop = components.get('chat/recent').offset().top;
|
||||||
|
|
||||||
if (messagesList.length) {
|
if (messagesList.length) {
|
||||||
var margin = $('.expanded-chat ul').outerHeight(true) - $('.expanded-chat ul').height();
|
var margin = $('.expanded-chat ul').outerHeight(true) - $('.expanded-chat ul').height();
|
||||||
var inputHeight = $('.chat-input').outerHeight(true);
|
var inputHeight = $('.chat-input').outerHeight(true);
|
||||||
var fromTop = messagesList.offset().top;
|
|
||||||
var searchHeight = $('.chat-search').height();
|
|
||||||
var searchListHeight = $('[component="chat/search/list"]').outerHeight(true) - $('[component="chat/search/list"]').height();
|
|
||||||
|
|
||||||
messagesList.height($(window).height() - (fromTop + inputHeight + (margin * 4)));
|
messagesList.height($(window).height() - (fromTop + inputHeight + (margin * 4)));
|
||||||
components.get('chat/recent').height($('.expanded-chat').height() - (searchHeight + searchListHeight));
|
components.get('chat/recent').height($('.expanded-chat').height() - (searchHeight + searchListHeight));
|
||||||
$('[component="chat/search/list"]').css('max-height', (components.get('chat/recent').height() / 2) + 'px');
|
$('[component="chat/search/list"]').css('max-height', (components.get('chat/recent').height() / 2) + 'px');
|
||||||
|
} else {
|
||||||
|
components.get('chat/recent').height($(window).height() - (fromTop + searchHeight + searchListHeight));
|
||||||
}
|
}
|
||||||
|
|
||||||
Chats.setActive();
|
Chats.setActive();
|
||||||
|
|||||||
Reference in New Issue
Block a user