mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40:08 +00:00
Reformatting
This commit is contained in:
parent
b73ba2168c
commit
e0a7943c1c
@ -54,25 +54,24 @@ if (typeof TimWolla.WCF == 'undefined') TimWolla.WCF = {};
|
||||
}, this));
|
||||
|
||||
$('#chatForm').submit($.proxy(function (event) {
|
||||
// check the input, if not empty send it.
|
||||
// break if input contains only whitespace
|
||||
if ($('#chatInput').val().trim().length === 0) return false;
|
||||
|
||||
event.preventDefault();
|
||||
textInput = $(event.target).find('#chatInput');
|
||||
submitButton = $(event.target).find('input[type=image]');
|
||||
|
||||
$.ajax('index.php/Chat/Send/', {
|
||||
dataType: 'json',
|
||||
data: { ajax: 1,
|
||||
text: textInput.val()
|
||||
},
|
||||
data: {
|
||||
text: $('#chatInput').val()
|
||||
},
|
||||
type: 'POST',
|
||||
beforeSend: $.proxy(function (jqXHR) {
|
||||
submitButton.attr('src', WCF.Icon.get('wcf.icon.loading'));
|
||||
}),
|
||||
success: $.proxy(function (data, textStatus, jqXHR) {
|
||||
this.getMessages();
|
||||
textInput.val('').focus();
|
||||
$('#chatInput').val('').focus();
|
||||
}, this),
|
||||
error: function() {
|
||||
// TODO: find a nicer solution.
|
||||
|
Loading…
Reference in New Issue
Block a user