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:
parent
9f563de4e8
commit
0bf39ff7a4
@ -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');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user