Spaces:
Running
Running
hide the order preview too when user not select a file
Browse files
script.js
CHANGED
|
@@ -41,6 +41,9 @@ const dropzone = document.getElementById('dropzone');
|
|
| 41 |
if (fileData) {
|
| 42 |
previewContainer.classList.toggle('hidden');
|
| 43 |
showPreviewLink.textContent = previewContainer.classList.contains('hidden') ? 'Show Preview' : 'Hide Preview';
|
|
|
|
|
|
|
|
|
|
| 44 |
}
|
| 45 |
});
|
| 46 |
// Drag and drop events
|
|
@@ -208,12 +211,14 @@ showPreviewLink.textContent = 'Hide Preview';
|
|
| 208 |
// Enable process button if merchant ID is filled
|
| 209 |
updateProcessButton();
|
| 210 |
}
|
| 211 |
-
|
| 212 |
function updateProcessButton() {
|
| 213 |
processBtn.disabled = !(fileData && merchantIdInput.value.trim());
|
|
|
|
|
|
|
|
|
|
|
|
|
| 214 |
}
|
| 215 |
-
|
| 216 |
-
merchantIdInput.addEventListener('input', updateProcessButton);
|
| 217 |
|
| 218 |
// Button actions
|
| 219 |
clearBtn.addEventListener('click', () => {
|
|
|
|
| 41 |
if (fileData) {
|
| 42 |
previewContainer.classList.toggle('hidden');
|
| 43 |
showPreviewLink.textContent = previewContainer.classList.contains('hidden') ? 'Show Preview' : 'Hide Preview';
|
| 44 |
+
} else {
|
| 45 |
+
previewContainer.classList.add('hidden');
|
| 46 |
+
showPreviewLink.textContent = 'Preview';
|
| 47 |
}
|
| 48 |
});
|
| 49 |
// Drag and drop events
|
|
|
|
| 211 |
// Enable process button if merchant ID is filled
|
| 212 |
updateProcessButton();
|
| 213 |
}
|
|
|
|
| 214 |
function updateProcessButton() {
|
| 215 |
processBtn.disabled = !(fileData && merchantIdInput.value.trim());
|
| 216 |
+
if (!fileData) {
|
| 217 |
+
previewContainer.classList.add('hidden');
|
| 218 |
+
showPreviewLink.textContent = 'Preview';
|
| 219 |
+
}
|
| 220 |
}
|
| 221 |
+
merchantIdInput.addEventListener('input', updateProcessButton);
|
|
|
|
| 222 |
|
| 223 |
// Button actions
|
| 224 |
clearBtn.addEventListener('click', () => {
|