From 583cbf290363ffcfdea9fa0ff76529f4acc278f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sun, 4 Mar 2012 20:02:37 +0100 Subject: [PATCH] Instantly clear the input Avoids problems with rapid typing --- file/js/TimWolla.WCF.Chat.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/file/js/TimWolla.WCF.Chat.coffee b/file/js/TimWolla.WCF.Chat.coffee index 7bd749c..97e79ce 100644 --- a/file/js/TimWolla.WCF.Chat.coffee +++ b/file/js/TimWolla.WCF.Chat.coffee @@ -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'