Ashrafb commited on
Commit
b7318df
1 Parent(s): 0590c54

Update static/index.html

Browse files
Files changed (1) hide show
  1. static/index.html +7 -5
static/index.html CHANGED
@@ -314,12 +314,10 @@ input[type="number"]#scale:focus {
314
  reader.readAsDataURL(file);
315
  }
316
 
317
- document.getElementById('uploadForm').addEventListener('submit', async function(event) {
 
318
  event.preventDefault();
319
  const formData = new FormData(this);
320
- const fileInput = document.getElementById('image');
321
-
322
-
323
 
324
  // Show the loading spinner
325
  const loadingSpinner = document.getElementById('loadingSpinner');
@@ -352,7 +350,11 @@ input[type="number"]#scale:focus {
352
  } catch (error) {
353
  console.error('Error:', error);
354
  }
355
- });
 
 
 
 
356
 
357
 
358
 
 
314
  reader.readAsDataURL(file);
315
  }
316
 
317
+ // Function to handle form submission
318
+ async function handleSubmit(event) {
319
  event.preventDefault();
320
  const formData = new FormData(this);
 
 
 
321
 
322
  // Show the loading spinner
323
  const loadingSpinner = document.getElementById('loadingSpinner');
 
350
  } catch (error) {
351
  console.error('Error:', error);
352
  }
353
+ }
354
+
355
+ // Add event listener to the form
356
+ document.getElementById('uploadForm').addEventListener('submit', handleSubmit);
357
+
358
 
359
 
360