1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2025-01-09 00:20:08 +00:00

Fix ajaxLoad onSubmit

This commit is contained in:
Tim Düsterhus 2011-12-18 15:33:47 +01:00
parent 9f563de4e8
commit 0bf39ff7a4
2 changed files with 15 additions and 18 deletions

View File

@ -170,27 +170,30 @@ if (typeof TimWolla.WCF == 'undefined') TimWolla.WCF = {};
if (options.submit) $('#chatForm').submit();
else $('#chatInput').focus();
},
refreshRoomList: function() {
$('.chatRoom').unbind('click');
},
submit: function (target) {
// break if input contains only whitespace
if ($('#chatInput').val().trim().length === 0) return false;
submitButton = target.find('input[type=image]');
$.ajax($('#chatForm').attr('action'), {
data: {
text: $('#chatInput').val()
},
type: 'POST',
beforeSend: $.proxy(function (jqXHR) {
submitButton.addClass('ajaxLoad');
$('#chatInput').addClass('ajaxLoad');
}),
success: $.proxy(function (data, textStatus, jqXHR) {
this.getMessages();
$('#chatInput').val('').focus();
}, this),
complete: function() {
submitButton.removeClass('ajaxLoad');
$('#chatInput').removeClass('ajaxLoad');
}
});
},

View File

@ -22,10 +22,6 @@
margin-bottom: -20px !important;
}
#sidebar {
/*height: 450px;*/
}
aside {
overflow: auto;
padding: 0 1px 0 0;
@ -73,8 +69,6 @@
}
#chatInput {
background-position: right center;
background-repeat: no-repeat;
position: relative;
z-index: 10;
}