mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-16 02:36:16 +01:00
drastically simplified main window resizing logic, some language changes
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"chat.chatting_with": "Chat with <span id=\"chat-with-name\"></span>",
|
"chat.chatting_with": "Chat with",
|
||||||
"chat.placeholder": "Type chat message here, press enter to send",
|
"chat.placeholder": "Type chat message here, press enter to send",
|
||||||
"chat.send": "Send",
|
"chat.send": "Send",
|
||||||
"chat.no_active": "You have no active chats.",
|
"chat.no_active": "You have no active chats.",
|
||||||
|
|||||||
@@ -407,22 +407,10 @@ define('forum/chats', [
|
|||||||
};
|
};
|
||||||
|
|
||||||
Chats.resizeMainWindow = function () {
|
Chats.resizeMainWindow = function () {
|
||||||
var messagesList = $('.expanded-chat .chat-content');
|
var viewportHeight = $(window).height();
|
||||||
var searchHeight = $('.chat-search').height();
|
var fromTop = components.get('chat/nav-wrapper').offset().top;
|
||||||
var searchListHeight = $('[component="chat/search/list"]').outerHeight(true) - $('[component="chat/search/list"]').height();
|
|
||||||
var fromTop = components.get('chat/recent').offset().top;
|
|
||||||
|
|
||||||
if (messagesList.length) {
|
|
||||||
var margin = $('.expanded-chat ul').outerHeight(true) - $('.expanded-chat ul').height();
|
|
||||||
var inputHeight = $('.chat-input').outerHeight(true);
|
|
||||||
|
|
||||||
messagesList.height($(window).height() - (fromTop + inputHeight + (margin * 4)));
|
|
||||||
components.get('chat/recent').height($('.expanded-chat').height() - (searchHeight + searchListHeight));
|
|
||||||
$('[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-full').height(viewportHeight - fromTop);
|
||||||
Chats.setActive();
|
Chats.setActive();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user