| ... | ... |
@@ -3,6 +3,7 @@ Xmpp.Views.Chat ||= {}
|
| 3 | 3 |
class Xmpp.Views.Chat.WindowView extends Backbone.View |
| 4 | 4 |
template: JST["backbone/templates/chat/window"] |
| 5 | 5 |
el: $('#conversation-js')
|
| 6 |
+ inputSelector: 'input[type=text]' |
|
| 6 | 7 |
|
| 7 | 8 |
maxHistoryLength: 20 |
| 8 | 9 |
|
| ... | ... |
@@ -30,6 +31,7 @@ class Xmpp.Views.Chat.WindowView extends Backbone.View |
| 30 | 30 |
show: -> |
| 31 | 31 |
$(@el).removeClass('hidden')
|
| 32 | 32 |
@delegateEvents() |
| 33 |
+ $(@el).find(@inputSelector).focus() |
|
| 33 | 34 |
this |
| 34 | 35 |
|
| 35 | 36 |
remove: -> |
| ... | ... |
@@ -44,9 +46,9 @@ class Xmpp.Views.Chat.WindowView extends Backbone.View |
| 44 | 44 |
sendMessage: (e) -> |
| 45 | 45 |
e.preventDefault() |
| 46 | 46 |
$this = $(e.currentTarget) |
| 47 |
- input = $this.find('input[type=text]')
|
|
| 47 |
+ input = $this.find(@inputSelector) |
|
| 48 | 48 |
message = input.val().trim() |
| 49 |
- input.val('')
|
|
| 49 |
+ input.val('').focus()
|
|
| 50 | 50 |
|
| 51 | 51 |
if (message) |
| 52 | 52 |
@tab.getOwner().sendMessage(message, @tab.getChatId() |