- more opactiy in qr code in second display
- disable all actions while waiting for qr pay
This commit is contained in:
Dev Team
2025-06-17 10:40:58 +06:30
parent 0d19349825
commit e48e7f960a
2 changed files with 46 additions and 2 deletions

View File

@@ -252,6 +252,50 @@
</div>
<script defer type="text/javascript">
// disable actions while waiting for payment
$(document).ready(function() {
$('button, a').not('#cancel-btn').each(function() {
const $element = $(this);
if ($element.is('button')) {
$element.prop('disabled', true);
}
// Disable links and dropdowns
$element.addClass('disabled');
$element.css({
'pointer-events': 'none',
'opacity': '0.5',
'cursor': 'not-allowed'
});
// Prevent click actions
$element.on('click', function(e) {
e.preventDefault();
e.stopImmediatePropagation();
});
});
// Specifically disable Bootstrap dropdowns
$('.dropdown-toggle').not('#cancel-btn').each(function() {
const $dropdown = $(this);
// Remove Bootstrap functionality
$dropdown.removeAttr('data-bs-toggle');
$dropdown.off('click.bs.dropdown');
// Add visual
$dropdown.addClass('disabled');
$dropdown.css({
'pointer-events': 'none',
'opacity': '0.5',
'cursor': 'not-allowed'
});
});
});
// payment success
$(document).ready(function() {
const $paymentWaiting = $('.payment-waiting');
const amountToReceive = <%= number_with_precision(@sale_data.grand_total, precision: precision.to_i) %>;