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