From 46ab479c86dba9adb319600fc1174037d14310af Mon Sep 17 00:00:00 2001 From: Dev Team Date: Wed, 18 Jun 2025 15:55:50 +0630 Subject: [PATCH] fix: nfc not working with jade --- .../foodcourt/orders/_read_modal.html.erb | 18 +--- .../foodcourt/orders/app_orders.html.erb | 99 +++++++++++++++++-- app/views/foodcourt/qrpay/init.html.erb | 13 ++- 3 files changed, 101 insertions(+), 29 deletions(-) diff --git a/app/views/foodcourt/orders/_read_modal.html.erb b/app/views/foodcourt/orders/_read_modal.html.erb index 423db09b..472ad500 100644 --- a/app/views/foodcourt/orders/_read_modal.html.erb +++ b/app/views/foodcourt/orders/_read_modal.html.erb @@ -207,29 +207,19 @@ document.addEventListener('DOMContentLoaded', function () { const paymentCards = document.querySelectorAll('.payment-card:not(.disabled)'); const cancelButton = document.querySelector('.btn-cancel'); - $('#read_modal').hide(); - $('.modal-backdrop.fade').css('display', 'none'); - - $('#read_nfc').on('hide.bs.modal', function() { - $('#payment_modal').css('display', 'none'); - $('.modal-backdrop.fade').css('display', 'none'); - }); - - $("#read_nfc").on('click', function() { - $('#payment_modal').css('display', 'none'); - $('.modal-backdrop.fade').css('display', 'none'); - }); + // $('#read_modal').hide(); + // $('.modal-backdrop.fade').css('display', 'none'); cancelButton.addEventListener('click', function () { + alert('cancel click'); console.log("Action: Cancel payment."); paymentCards.forEach(c => c.classList.remove('active')); + $('.payment-card').css('display', 'none'); }); - const disabledNfcCard = document.querySelector('.payment-card.disabled'); - document.querySelector('.payment-card#dynamic_qr').addEventListener('click', function() { initDynamicQrPay(); }); diff --git a/app/views/foodcourt/orders/app_orders.html.erb b/app/views/foodcourt/orders/app_orders.html.erb index b705c874..7af73bce 100644 --- a/app/views/foodcourt/orders/app_orders.html.erb +++ b/app/views/foodcourt/orders/app_orders.html.erb @@ -518,7 +518,86 @@ <%= render "read_modal" %> -