mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-11-15 02:21:21 +01:00
set msg box to readonly on send
This commit is contained in:
parent
62189811df
commit
f056b303f8
@ -374,6 +374,7 @@ $("#messagebox").keyup(function(event){
|
|||||||
if(event.keyCode == 13 && $(this).val().length >= 1 && $(this).val().length <= 350) {
|
if(event.keyCode == 13 && $(this).val().length >= 1 && $(this).val().length <= 350) {
|
||||||
$(this).val($.trim($(this).val()));
|
$(this).val($.trim($(this).val()));
|
||||||
$(this).blur();
|
$(this).blur();
|
||||||
|
$("#messagebox").attr('readonly', true);
|
||||||
var funct = post(selected_channel, $(this).val());
|
var funct = post(selected_channel, $(this).val());
|
||||||
funct.done(function(data) {
|
funct.done(function(data) {
|
||||||
$("#messagebox").val("");
|
$("#messagebox").val("");
|
||||||
@ -388,6 +389,9 @@ $("#messagebox").keyup(function(event){
|
|||||||
Materialize.toast('You are sending messages too fast! 1 message per 10 seconds', 10000);
|
Materialize.toast('You are sending messages too fast! 1 message per 10 seconds', 10000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
funct.always(function() {
|
||||||
|
$("#messagebox").attr('readonly', false);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user