mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-22 08:20:36 +01:00
feat: #7627, close chat on ajaxify on mobile
This commit is contained in:
@@ -315,12 +315,17 @@ define('chat', [
|
|||||||
modalEl.attr('data-mobile', '1');
|
modalEl.attr('data-mobile', '1');
|
||||||
var messagesEl = modalEl.find('.modal-body');
|
var messagesEl = modalEl.find('.modal-body');
|
||||||
messagesEl.css('height', module.calculateChatListHeight(modalEl));
|
messagesEl.css('height', module.calculateChatListHeight(modalEl));
|
||||||
|
function resize() {
|
||||||
$(window).on('resize', function () {
|
|
||||||
messagesEl.css('height', module.calculateChatListHeight(modalEl));
|
messagesEl.css('height', module.calculateChatListHeight(modalEl));
|
||||||
require(['forum/chats/messages'], function (ChatsMessages) {
|
require(['forum/chats/messages'], function (ChatsMessages) {
|
||||||
ChatsMessages.scrollToBottom(modalEl.find('.chat-content'));
|
ChatsMessages.scrollToBottom(modalEl.find('.chat-content'));
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$(window).on('resize', resize);
|
||||||
|
$(window).one('action:ajaxify.start', function () {
|
||||||
|
module.close(modalEl);
|
||||||
|
$(window).off('resize', resize);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user