From: eileen Date: Tue, 17 May 2016 13:53:16 +0000 (+1200) Subject: CRM-18424 fix recur checkbox issue found in QA. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=de4cd6a249434281fa87098440343108cc30d18f;p=civicrm-core.git 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 --- 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( ); - } } }