nagasurendra commited on
Commit
5d75078
·
verified ·
1 Parent(s): e270dfe

Update templates/menu.html

Browse files
Files changed (1) hide show
  1. templates/menu.html +7 -0
templates/menu.html CHANGED
@@ -1380,18 +1380,25 @@
1380
 
1381
  decreaseBtn.addEventListener('click', function () {
1382
  let currentQuantity = parseInt(quantityInput.value);
 
1383
  if (currentQuantity > 1) {
1384
  currentQuantity--;
1385
  quantityInput.value = currentQuantity;
 
 
 
1386
  }
1387
  });
1388
 
1389
  increaseBtn.addEventListener('click', function () {
1390
  let currentQuantity = parseInt(quantityInput.value);
 
1391
  currentQuantity++;
1392
  quantityInput.value = currentQuantity;
 
1393
  });
1394
 
 
1395
  const softDrinkDecreaseBtn = document.getElementById('soft-drink-decrease');
1396
  const softDrinkIncreaseBtn = document.getElementById('soft-drink-increase');
1397
  const softDrinkQuantityInput = document.getElementById('soft-drink-quantity');
 
1380
 
1381
  decreaseBtn.addEventListener('click', function () {
1382
  let currentQuantity = parseInt(quantityInput.value);
1383
+ console.log('Decrease clicked, current quantity:', currentQuantity); // Print current quantity
1384
  if (currentQuantity > 1) {
1385
  currentQuantity--;
1386
  quantityInput.value = currentQuantity;
1387
+ console.log('Decreased quantity:', currentQuantity); // Print new quantity after decrease
1388
+ } else {
1389
+ console.log('Quantity cannot go below 1');
1390
  }
1391
  });
1392
 
1393
  increaseBtn.addEventListener('click', function () {
1394
  let currentQuantity = parseInt(quantityInput.value);
1395
+ console.log('Increase clicked, current quantity:', currentQuantity); // Print current quantity
1396
  currentQuantity++;
1397
  quantityInput.value = currentQuantity;
1398
+ console.log('Increased quantity:', currentQuantity); // Print new quantity after increase
1399
  });
1400
 
1401
+
1402
  const softDrinkDecreaseBtn = document.getElementById('soft-drink-decrease');
1403
  const softDrinkIncreaseBtn = document.getElementById('soft-drink-increase');
1404
  const softDrinkQuantityInput = document.getElementById('soft-drink-quantity');