Spaces:
Sleeping
Sleeping
Update static/index.html
Browse files- 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 |
-
|
|
|
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 |
|