From 445dae586ecc9e638e475dad103fb42e2f7418d3 Mon Sep 17 00:00:00 2001 From: Junior Date: Sun, 22 Nov 2026 14:21:02 -0500 Subject: [PATCH] Disable completion buttons during ajax calls to back-end --- js/main.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/main.js b/js/main.js index 880de1d..77c3193 100644 --- a/js/main.js +++ b/js/main.js @@ -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); } }); }