From 4bf5fb21e3b6eba575bb86d13b6521f5c773098d Mon Sep 17 00:00:00 2001 From: Alex Bozarth Date: Tue, 28 Aug 2018 18:05:58 -0700 Subject: [PATCH] Disable upload button while predicting (#11) Currently if you try uploading an image while one is already processing it will display the new image but use the canvas for the first image. --- static/js/webapp.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/static/js/webapp.js b/static/js/webapp.js index 90241c9..56b2bd9 100644 --- a/static/js/webapp.js +++ b/static/js/webapp.js @@ -160,6 +160,7 @@ $(function() { if ($('#file-input').val() !== '') { $('#file-submit').text('Detecting...'); + $('#file-submit').prop('disabled', true); // Perform file upload $.ajax({ @@ -181,6 +182,7 @@ $(function() { }, complete: function() { $('#file-submit').text('Submit'); + $('#file-submit').prop('disabled', false); $('#file-input').val(''); }, });