Spaces:
Build error
Build error
Update static/script.js
Browse files- static/script.js +13 -15
static/script.js
CHANGED
|
@@ -208,25 +208,23 @@ function displayCustomizationIngredients(ingredients) {
|
|
| 208 |
ingredientsDiv.textContent = selectedIngredientsText;
|
| 209 |
selectedArea.appendChild(ingredientsDiv);
|
| 210 |
|
| 211 |
-
//
|
| 212 |
-
if (
|
| 213 |
-
let submitButton = document.
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
textarea.placeholder = 'Enter any special instructions...';
|
| 224 |
-
selectedArea.appendChild(textarea);
|
| 225 |
-
}
|
| 226 |
}
|
| 227 |
}
|
| 228 |
|
| 229 |
|
|
|
|
| 230 |
function submitCustomizationIngredients() {
|
| 231 |
// Handle the submission of ingredients and instructions here
|
| 232 |
console.log("Ingredients submitted:", selectedIngredients);
|
|
|
|
| 208 |
ingredientsDiv.textContent = selectedIngredientsText;
|
| 209 |
selectedArea.appendChild(ingredientsDiv);
|
| 210 |
|
| 211 |
+
// Ensure the submit button and custom instructions box appear even when multiple ingredients are selected
|
| 212 |
+
if (!document.querySelector('.submit-customization-button')) {
|
| 213 |
+
let submitButton = document.createElement('button');
|
| 214 |
+
submitButton.className = 'submit-customization-button';
|
| 215 |
+
submitButton.textContent = 'Submit Ingredients';
|
| 216 |
+
submitButton.onclick = submitCustomizationIngredients;
|
| 217 |
+
chatMessages.appendChild(submitButton);
|
| 218 |
+
|
| 219 |
+
// Adding a text area for custom instructions
|
| 220 |
+
const textarea = document.createElement('textarea');
|
| 221 |
+
textarea.placeholder = 'Enter any special instructions...';
|
| 222 |
+
selectedArea.appendChild(textarea);
|
|
|
|
|
|
|
|
|
|
| 223 |
}
|
| 224 |
}
|
| 225 |
|
| 226 |
|
| 227 |
+
|
| 228 |
function submitCustomizationIngredients() {
|
| 229 |
// Handle the submission of ingredients and instructions here
|
| 230 |
console.log("Ingredients submitted:", selectedIngredients);
|