1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-22 21:40:08 +00:00

Instantly clear the input

Avoids problems with rapid typing
This commit is contained in:
Tim Düsterhus 2012-03-04 20:02:37 +01:00
parent d2ad9670b7
commit 583cbf2903

View File

@ -428,17 +428,17 @@ consoleMock ?=
# Finally free the fish
@freeTheFish() if $('#timsChatInput').val().trim().toLowerCase() is '/free the fish'
text = $('#timsChatInput').val()
$('#timsChatInput').val('').focus().keyup()
$.ajax $('#timsChatForm').attr('action'),
data:
text: $('#timsChatInput').val(),
text: text
smilies: $('#timsChatSmilies').data('status')
type: 'POST',
beforeSend: (jqXHR) ->
$('#timsChatInput').addClass 'ajaxLoad'
success: $.proxy((data, textStatus, jqXHR) ->
@getMessages()
$('#timsChatInput').val('').focus()
$('#timsChatInput').keyup()
, @)
complete: () ->
$('#timsChatInput').removeClass 'ajaxLoad'