Fixes focusing on write area or nickname input when chat is open.
This commit is contained in:
parent
d8dd564b06
commit
e1512e3776
|
@ -179,6 +179,13 @@ var Chat = {
|
||||||
|
|
||||||
unreadMessages = 0;
|
unreadMessages = 0;
|
||||||
updateVisualNotification();
|
updateVisualNotification();
|
||||||
|
|
||||||
|
// if we are in conversation mode focus on the text input
|
||||||
|
// if we are not, focus on the display name input
|
||||||
|
if (APP.settings.getDisplayName())
|
||||||
|
$('#usermsg').focus();
|
||||||
|
else
|
||||||
|
$('#nickinput').focus();
|
||||||
});
|
});
|
||||||
|
|
||||||
addSmileys();
|
addSmileys();
|
||||||
|
@ -259,12 +266,18 @@ var Chat = {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the chat conversation mode.
|
* Sets the chat conversation mode.
|
||||||
|
* Conversation mode is the normal chat mode, non conversation mode is
|
||||||
|
* where we ask user to input its display name.
|
||||||
* @param {boolean} isConversationMode if chat should be in
|
* @param {boolean} isConversationMode if chat should be in
|
||||||
* conversation mode or not.
|
* conversation mode or not.
|
||||||
*/
|
*/
|
||||||
setChatConversationMode (isConversationMode) {
|
setChatConversationMode (isConversationMode) {
|
||||||
$('#' + CHAT_CONTAINER_ID)
|
$('#' + CHAT_CONTAINER_ID)
|
||||||
.toggleClass('is-conversation-mode', isConversationMode);
|
.toggleClass('is-conversation-mode', isConversationMode);
|
||||||
|
|
||||||
|
// this is needed when we transition from no conversation mode to
|
||||||
|
// conversation mode. When user enters his nickname and hits enter,
|
||||||
|
// to focus on the write area.
|
||||||
if (isConversationMode) {
|
if (isConversationMode) {
|
||||||
$('#usermsg').focus();
|
$('#usermsg').focus();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue