CRM-20392: remove cruft code and add unit test
[civicrm-core.git] / templates / CRM / Contribute / Form / AdditionalPayment.tpl
index 93c93b6211cc9b3d1c54f9c6aef4fd5debe0b953..04da3159fc887903710b03a06f8530a609b88d8a 100644 (file)
         });
 
         function checkEmailDependancies() {
-          if ($('#is_email_receipt', $form).attr('checked')) {
-            $('#fromEmail, #notice', $form).show();
-            $('#receiptDate', $form).hide();
+          if ($('#is_email_receipt', $form).prop('checked')) {
+            $('#fromEmail', $form).show();
           }
           else {
-            $('#fromEmail, #notice', $form).hide( );
-            $('#receiptDate', $form).show();
-          }
-        }
-
-        // bind first click of accordion header to load crm-accordion-body with snippet
-        $('#adjust-option-type', $form).hide();
-        $('.crm-ajax-accordion .crm-accordion-header', $form).one('click', function() {
-          loadPanes($(this).attr('id'));
-        });
-        $('.crm-ajax-accordion:not(.collapsed) .crm-accordion-header', $form).each(function(index) {
-          loadPanes($(this).attr('id'));
-        });
-        // load panes function call for snippet based on id of crm-accordion-header
-        function loadPanes(id) {
-          var url = "{/literal}{crmURL p='civicrm/payment/add' q='formType=' h=0}{literal}" + id;
-          {/literal}
-          {if $contributionMode}
-            url += "&mode={$contributionMode}";
-          {/if}
-          {if $qfKey}
-            url += "&qfKey={$qfKey}";
-          {/if}
-          {literal}
-          if (!$('div.'+ id, $form).html()) {
-            CRM.loadPage(url, {target: $('div.' + id, $form)});
+           $('#fromEmail', $form).hide( );
           }
         }