From de4cd6a249434281fa87098440343108cc30d18f Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 18 May 2016 01:53:16 +1200 Subject: [PATCH] CRM-18424 fix recur checkbox issue found in QA. On digging into it I found the showHideAutoRenew function was robust enough to be called in both a hide & a show situation. So, yay, further minor simplification --- templates/CRM/Contribute/Form/Contribution/Main.tpl | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/templates/CRM/Contribute/Form/Contribution/Main.tpl b/templates/CRM/Contribute/Form/Contribution/Main.tpl index 50d1f356d0..d0406229ed 100644 --- a/templates/CRM/Contribute/Form/Contribution/Main.tpl +++ b/templates/CRM/Contribute/Form/Contribution/Main.tpl @@ -322,22 +322,16 @@ function toggleRecur( ) { var isRecur = cj('input[id="is_recur"]:checked'); var allowAutoRenew = {/literal}'{$allowAutoRenewMembership}'{literal}; + if ( allowAutoRenew && cj("#auto_renew") ) { + showHideAutoRenew( null ); + } if (isRecur.val() > 0) { cj('#recurHelp').show(); cj('#amount_sum_label').text(ts('Regular amount')); - //get back to auto renew settings. - if ( allowAutoRenew && cj("#auto_renew") ) { - showHideAutoRenew( null ); - } } else { cj('#recurHelp').hide(); cj('#amount_sum_label').text(ts('Total amount')); - //disabled auto renew settings. - if ( allowAutoRenew && cj("#auto_renew") ) { - cj("#auto_renew").prop('checked', false ); - cj('#allow_auto_renew').hide( ); - } } } -- 2.25.1