Disable completion buttons during ajax calls to back-end
This commit is contained in:
parent
7cf29a7607
commit
445dae586e
|
|
@ -103,6 +103,8 @@ function deleteTask() {
|
|||
|
||||
function setTaskCompleteState(complete = TASKCOMPLETE) {
|
||||
if ( $("#form_id").val() == "0" ) return;
|
||||
$("#form_complete").prop("disabled", true);
|
||||
$("#form_incomplete").prop("disabled", true);
|
||||
$.ajax({
|
||||
url: 'ajax/task-setcomplete.php',
|
||||
type: 'POST',
|
||||
|
|
@ -123,6 +125,10 @@ function setTaskCompleteState(complete = TASKCOMPLETE) {
|
|||
},
|
||||
error: function(jqo, stat, error) {
|
||||
toastr.error("Could not communicate with server!", "Server Error");
|
||||
},
|
||||
complete: function() {
|
||||
$("#form_complete").prop("disabled", false);
|
||||
$("#form_incomplete").prop("disabled", false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user