Always set focus on message input after message sent

Fixes #66
This commit is contained in:
Dmitriy Simushev 2014-10-14 11:03:20 +00:00
parent 397786991d
commit 3fbc5fa262

View File

@ -40,9 +40,7 @@
'keydown #message-input': 'messageKeyDown',
'keyup #message-input': 'checkUserTyping',
'change #message-input': 'checkUserTyping',
'change #predefined': 'selectPredefinedAnswer',
'focus #message-input': 'setFocus',
'blur #message-input': 'dropFocus'
'change #predefined': 'selectPredefinedAnswer'
},
/**
@ -149,9 +147,8 @@
postMessageComplete: function() {
this.clearInput();
this.enableInput();
if (this.focused) {
// Always set focus on message input after message sent
this.ui.message.focus();
}
Mibew.Objects.Collections.messages.off(
'multiple:add',
this.postMessageComplete,
@ -193,20 +190,6 @@
}
},
/**
* Set focus indicator
*/
setFocus: function() {
this.focused = true;
},
/**
* Unset focus indicator
*/
dropFocus: function() {
this.focused = false;
},
/**
* Builds a string with send shortcut.
*