mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 22:15:48 +01:00
closes #2530
This commit is contained in:
@@ -291,6 +291,7 @@ app.uid = null;
|
|||||||
function loadAndCenter(chatModal) {
|
function loadAndCenter(chatModal) {
|
||||||
chat.load(chatModal.attr('UUID'));
|
chat.load(chatModal.attr('UUID'));
|
||||||
chat.center(chatModal);
|
chat.center(chatModal);
|
||||||
|
chat.focusInput(chatModal);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!chat.modalExists(touid)) {
|
if (!chat.modalExists(touid)) {
|
||||||
|
|||||||
@@ -293,6 +293,10 @@ define('chat', ['taskbar', 'string', 'sounds', 'forum/chats'], function(taskbar,
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module.focusInput = function(chatModal) {
|
||||||
|
chatModal.find('#chat-message-input').focus();
|
||||||
|
};
|
||||||
|
|
||||||
module.close = function(chatModal) {
|
module.close = function(chatModal) {
|
||||||
clearInterval(chatModal.attr('intervalId'));
|
clearInterval(chatModal.attr('intervalId'));
|
||||||
chatModal.attr('intervalId', 0);
|
chatModal.attr('intervalId', 0);
|
||||||
@@ -310,7 +314,7 @@ define('chat', ['taskbar', 'string', 'sounds', 'forum/chats'], function(taskbar,
|
|||||||
}
|
}
|
||||||
chatModal.css('left', Math.max(0, (($(window).width() - $(chatModal).outerWidth()) / 2) + $(window).scrollLeft()) + 'px');
|
chatModal.css('left', Math.max(0, (($(window).width() - $(chatModal).outerWidth()) / 2) + $(window).scrollLeft()) + 'px');
|
||||||
chatModal.css('top', Math.max(0, $(window).height() / 2 - $(chatModal).outerHeight() / 2) + 'px');
|
chatModal.css('top', Math.max(0, $(window).height() / 2 - $(chatModal).outerHeight() / 2) + 'px');
|
||||||
chatModal.find('#chat-message-input').focus();
|
|
||||||
if (hideAfter) {
|
if (hideAfter) {
|
||||||
chatModal.addClass('hide');
|
chatModal.addClass('hide');
|
||||||
}
|
}
|
||||||
@@ -324,6 +328,7 @@ define('chat', ['taskbar', 'string', 'sounds', 'forum/chats'], function(taskbar,
|
|||||||
taskbar.updateActive(uuid);
|
taskbar.updateActive(uuid);
|
||||||
Chats.scrollToBottom(chatModal.find('#chat-content'));
|
Chats.scrollToBottom(chatModal.find('#chat-content'));
|
||||||
module.bringModalToTop(chatModal);
|
module.bringModalToTop(chatModal);
|
||||||
|
module.focusInput(chatModal);
|
||||||
socket.emit('modules.chats.markRead', chatModal.attr('touid'));
|
socket.emit('modules.chats.markRead', chatModal.attr('touid'));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user