Skip to content

Commit

Permalink
CRM-18424 fix recur checkbox issue found in QA.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
eileenmcnaughton committed May 17, 2016
1 parent 3dafdf1 commit 6007f50
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions templates/CRM/Contribute/Form/Contribution/Main.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -322,22 +322,18 @@
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( );
}
}
}

Expand Down

0 comments on commit 6007f50

Please sign in to comment.