mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-29 18:59:58 +01:00
more fixes to better handle transitioning from chat to chat and closing chats, etc.
also modals no longer used on mobile view at all
This commit is contained in:
@@ -29,13 +29,13 @@ define('forum/chats', [
|
||||
Chats.addEventListeners();
|
||||
Chats.createTagsInput($('[component="chat/messages"] .users-tag-input'), ajaxify.data);
|
||||
Chats.createAutoComplete($('[component="chat/input"]'));
|
||||
Chats.resizeMainWindow();
|
||||
|
||||
components.get('expanded-chat/controlsToggle').on('click', function () {
|
||||
components.get('expanded-chat/controls').toggleClass('hide');
|
||||
});
|
||||
|
||||
if (env === 'md' || env === 'lg') {
|
||||
Chats.resizeMainWindow();
|
||||
Chats.addHotkeys();
|
||||
}
|
||||
|
||||
@@ -409,7 +409,7 @@ define('forum/chats', [
|
||||
|
||||
Chats.resizeMainWindow = function () {
|
||||
var viewportHeight = $(window).height();
|
||||
var fromTop = components.get('chat/nav-wrapper').offset().top;
|
||||
var fromTop = components.get('chat/main-wrapper').offset().top || components.get('chat/nav-wrapper').offset().top;
|
||||
|
||||
$('.chats-full').height(viewportHeight - fromTop);
|
||||
Chats.setActive();
|
||||
@@ -422,6 +422,8 @@ define('forum/chats', [
|
||||
}
|
||||
$('.chats-list li').removeClass('bg-info');
|
||||
$('.chats-list li[data-roomid="' + ajaxify.data.roomId + '"]').addClass('bg-info');
|
||||
|
||||
components.get('chat/nav-wrapper').attr('data-loaded', ajaxify.data.roomId ? '1' : '0');
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -12,12 +12,7 @@ define('forum/chats/recent', function () {
|
||||
});
|
||||
|
||||
$('[component="chat/recent"]').on('click', '[component="chat/recent/room"]', function () {
|
||||
var env = utils.findBootstrapEnvironment();
|
||||
if (env === 'xs' || env === 'sm') {
|
||||
app.openChat($(this).attr('data-roomid'));
|
||||
} else {
|
||||
Chats.switchChat($(this).attr('data-roomid'));
|
||||
}
|
||||
Chats.switchChat($(this).attr('data-roomid'));
|
||||
});
|
||||
|
||||
$('[component="chat/recent"]').on('scroll', function () {
|
||||
|
||||
Reference in New Issue
Block a user