about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2025-01-15 10:08:44 -0600
committerFrederick Muriuki Muriithi2025-01-15 10:10:14 -0600
commitb8726483575707444fd327d641782a09a6a6b27e (patch)
treefac168c9290bdc03056d5cb835eeeb7f74e2a808
parent81a8136f0844e43b1d0ce1059b1263fc9fd53d5b (diff)
downloadgn-uploader-b8726483575707444fd327d641782a09a6a6b27e.tar.gz
Disable "Upload Phenotypes" button on click; reenable on error.
Disable the button when the user clicks the button, and only re-enable
it iff an upload error occurs.
-rw-r--r--uploader/templates/phenotypes/add-phenotypes-raw-files.html2
1 files changed, 2 insertions, 0 deletions
diff --git a/uploader/templates/phenotypes/add-phenotypes-raw-files.html b/uploader/templates/phenotypes/add-phenotypes-raw-files.html
index 568cf0b..ccdbde5 100644
--- a/uploader/templates/phenotypes/add-phenotypes-raw-files.html
+++ b/uploader/templates/phenotypes/add-phenotypes-raw-files.html
@@ -577,6 +577,7 @@
 
   var uploadError = () => {
       return (message, file) => {
+          $("#frm-add-phenotypes input[type=submit]").attr("disabled")
           console.log("THE FILE:", file);
           console.log("THE ERROR MESSAGE:", message);
       };
@@ -643,6 +644,7 @@
       // TODO: Verify that files are not duplicated
       // TODO: Check all fields
       // Start the uploads.
+      event.target.setAttribute("disabled", "disabled");
       resumables.forEach((r) => {r.upload();});
   });
 </script>