mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fix bug when using Braintree and terms checkbox
This commit is contained in:
parent
72cbea9a0c
commit
b4437c645b
@ -67,7 +67,12 @@
|
||||
});
|
||||
paypalLink.click(function(e){
|
||||
e.preventDefault();
|
||||
@if ($account->requiresAuthorization($invoice))
|
||||
window.pendingPaymentFunction = checkout.paypal.initAuthFlow;
|
||||
showAuthorizationModal();
|
||||
@else
|
||||
checkout.paypal.initAuthFlow();
|
||||
@endif
|
||||
})
|
||||
});
|
||||
</script>
|
||||
@ -212,19 +217,11 @@
|
||||
$('#paymentButtons a').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
window.pendingPaymentHref = $(this).attr('href');
|
||||
@if ($account->showSignature($invoice))
|
||||
if (window.pendingPaymentInit) {
|
||||
$("#signature").jSignature('reset');
|
||||
}
|
||||
@endif
|
||||
@if ($account->showAcceptTerms($invoice))
|
||||
$('#termsCheckbox').attr('checked', false);
|
||||
@endif
|
||||
$('#authenticationModal').modal('show');
|
||||
showAuthorizationModal();
|
||||
});
|
||||
|
||||
@if ($account->showSignature($invoice))
|
||||
$('#authenticationModal').on('shown.bs.modal', function () {
|
||||
$('#authorizationModal').on('shown.bs.modal', function () {
|
||||
if ( ! window.pendingPaymentInit) {
|
||||
window.pendingPaymentInit = true;
|
||||
$("#signature").jSignature().bind('change', function(e) {
|
||||
@ -236,6 +233,18 @@
|
||||
@endif
|
||||
});
|
||||
|
||||
function showAuthorizationModal() {
|
||||
@if ($account->showSignature($invoice))
|
||||
if (window.pendingPaymentInit) {
|
||||
$("#signature").jSignature('reset');
|
||||
}
|
||||
@endif
|
||||
@if ($account->showAcceptTerms($invoice))
|
||||
$('#termsCheckbox').attr('checked', false);
|
||||
@endif
|
||||
$('#authorizationModal').modal('show');
|
||||
}
|
||||
|
||||
function onDownloadClick() {
|
||||
try {
|
||||
var doc = generatePDF(invoice, invoice.invoice_design.javascript, true);
|
||||
@ -274,9 +283,13 @@
|
||||
}
|
||||
|
||||
function redirectToPayment() {
|
||||
$('#authenticationModal').modal('hide');
|
||||
$('#authorizationModal').modal('hide');
|
||||
if (window.pendingPaymentFunction) {
|
||||
window.pendingPaymentFunction();
|
||||
} else {
|
||||
location.href = window.pendingPaymentHref;
|
||||
}
|
||||
}
|
||||
|
||||
function setModalPayNowEnabled() {
|
||||
var disabled = false;
|
||||
@ -328,7 +341,7 @@
|
||||
@endif
|
||||
|
||||
@if ($account->requiresAuthorization($invoice))
|
||||
<div class="modal fade" id="authenticationModal" tabindex="-1" role="dialog" aria-labelledby="authenticationModalLabel" aria-hidden="true">
|
||||
<div class="modal fade" id="authorizationModal" tabindex="-1" role="dialog" aria-labelledby="authorizationModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
|
Loading…
x
Reference in New Issue
Block a user