From b8726483575707444fd327d641782a09a6a6b27e Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 15 Jan 2025 10:08:44 -0600 Subject: 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. --- uploader/templates/phenotypes/add-phenotypes-raw-files.html | 2 ++ 1 file changed, 2 insertions(+) (limited to 'uploader/templates/phenotypes') 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();}); }); -- cgit v1.2.3