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();
|
if (options.submit) $('#chatForm').submit();
|
||||||
else $('#chatInput').focus();
|
else $('#chatInput').focus();
|
||||||
|
},
|
||||||
|
refreshRoomList: function() {
|
||||||
|
$('.chatRoom').unbind('click');
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
submit: function (target) {
|
submit: function (target) {
|
||||||
// break if input contains only whitespace
|
// break if input contains only whitespace
|
||||||
if ($('#chatInput').val().trim().length === 0) return false;
|
if ($('#chatInput').val().trim().length === 0) return false;
|
||||||
|
|
||||||
submitButton = target.find('input[type=image]');
|
|
||||||
|
|
||||||
$.ajax($('#chatForm').attr('action'), {
|
$.ajax($('#chatForm').attr('action'), {
|
||||||
data: {
|
data: {
|
||||||
text: $('#chatInput').val()
|
text: $('#chatInput').val()
|
||||||
},
|
},
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
beforeSend: $.proxy(function (jqXHR) {
|
beforeSend: $.proxy(function (jqXHR) {
|
||||||
submitButton.addClass('ajaxLoad');
|
$('#chatInput').addClass('ajaxLoad');
|
||||||
}),
|
}),
|
||||||
success: $.proxy(function (data, textStatus, jqXHR) {
|
success: $.proxy(function (data, textStatus, jqXHR) {
|
||||||
this.getMessages();
|
this.getMessages();
|
||||||
$('#chatInput').val('').focus();
|
$('#chatInput').val('').focus();
|
||||||
}, this),
|
}, this),
|
||||||
complete: function() {
|
complete: function() {
|
||||||
submitButton.removeClass('ajaxLoad');
|
$('#chatInput').removeClass('ajaxLoad');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -22,10 +22,6 @@
|
|||||||
margin-bottom: -20px !important;
|
margin-bottom: -20px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#sidebar {
|
|
||||||
/*height: 450px;*/
|
|
||||||
}
|
|
||||||
|
|
||||||
aside {
|
aside {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding: 0 1px 0 0;
|
padding: 0 1px 0 0;
|
||||||
@ -73,8 +69,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#chatInput {
|
#chatInput {
|
||||||
background-position: right center;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user