Update templates/menu.html
Browse files- templates/menu.html +2 -6
templates/menu.html
CHANGED
@@ -591,9 +591,6 @@ form-check-input addon-option{
|
|
591 |
|
592 |
<!-- JavaScript -->
|
593 |
<script>
|
594 |
-
|
595 |
-
// Show item details and fetch customization options
|
596 |
-
// Show item details and fetch customization options
|
597 |
// Show item details and fetch customization options
|
598 |
function showItemDetails(name, price, image, description, section, selectedCategory) {
|
599 |
console.log(`Showing details for: ${name}`);
|
@@ -659,9 +656,9 @@ function showItemDetails(name, price, image, description, section, selectedCateg
|
|
659 |
|
660 |
const checkboxes = document.querySelectorAll('.addon-option');
|
661 |
checkboxes.forEach(checkbox => {
|
662 |
-
const checkboxName = checkbox.getAttribute('data-name');
|
663 |
// If the checkbox option is one of the most common add-ons, select it
|
664 |
-
if (window.most_common_addons.includes(checkboxName)) {
|
665 |
console.log(`Pre-selecting checkbox for: ${checkboxName}`);
|
666 |
checkbox.checked = true;
|
667 |
} else {
|
@@ -679,7 +676,6 @@ function showItemDetails(name, price, image, description, section, selectedCateg
|
|
679 |
}
|
680 |
|
681 |
|
682 |
-
|
683 |
function handleToggle(source) {
|
684 |
const form = document.getElementById("filter-form");
|
685 |
const veg = document.getElementById("veg-toggle");
|
|
|
591 |
|
592 |
<!-- JavaScript -->
|
593 |
<script>
|
|
|
|
|
|
|
594 |
// Show item details and fetch customization options
|
595 |
function showItemDetails(name, price, image, description, section, selectedCategory) {
|
596 |
console.log(`Showing details for: ${name}`);
|
|
|
656 |
|
657 |
const checkboxes = document.querySelectorAll('.addon-option');
|
658 |
checkboxes.forEach(checkbox => {
|
659 |
+
const checkboxName = checkbox.getAttribute('data-name').trim(); // Trim spaces
|
660 |
// If the checkbox option is one of the most common add-ons, select it
|
661 |
+
if (window.most_common_addons.map(addon => addon.trim()).includes(checkboxName)) {
|
662 |
console.log(`Pre-selecting checkbox for: ${checkboxName}`);
|
663 |
checkbox.checked = true;
|
664 |
} else {
|
|
|
676 |
}
|
677 |
|
678 |
|
|
|
679 |
function handleToggle(source) {
|
680 |
const form = document.getElementById("filter-form");
|
681 |
const veg = document.getElementById("veg-toggle");
|