From 0b2b25838397a466f5433d895c53df4625a34442 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 29 Jul 2014 20:33:22 +0100 Subject: [PATCH] CRM-14882 - Fix js for showing/hiding billing block when fee is zero --- templates/CRM/Contribute/Form/Contribution/Main.tpl | 6 +----- templates/CRM/Price/Form/Calculate.tpl | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/templates/CRM/Contribute/Form/Contribution/Main.tpl b/templates/CRM/Contribute/Form/Contribution/Main.tpl index 66012aede7..4fe19ea10e 100644 --- a/templates/CRM/Contribute/Form/Contribution/Main.tpl +++ b/templates/CRM/Contribute/Form/Contribution/Main.tpl @@ -470,11 +470,7 @@ } } - CRM.$('#pricevalue').each(toggleBillingBlockIfFree); - - $('#priceset input').on('change', function() { - CRM.$('#pricevalue').each(toggleBillingBlockIfFree); - }); + $('#pricevalue').each(toggleBillingBlockIfFree).on('change', toggleBillingBlockIfFree); }); {/literal} diff --git a/templates/CRM/Price/Form/Calculate.tpl b/templates/CRM/Price/Form/Calculate.tpl index 1b4f86a105..ac152854a2 100644 --- a/templates/CRM/Price/Form/Calculate.tpl +++ b/templates/CRM/Price/Form/Calculate.tpl @@ -200,7 +200,7 @@ function display( totalfee ) { scriptfee = totalfee; scriptarray = price; cj('#total_amount').val( totalfee ); - cj('#pricevalue').data('raw-total', totalfee ); + cj('#pricevalue').data('raw-total', totalfee).trigger('change'); ( totalfee < 0 ) ? cj('table#pricelabel').addClass('disabled') : cj('table#pricelabel').removeClass('disabled'); if (typeof skipPaymentMethod == 'function') { -- 2.25.1