Cleanup duplicate js
authorColeman Watts <coleman@civicrm.org>
Wed, 27 Jan 2016 21:51:34 +0000 (16:51 -0500)
committerColeman Watts <coleman@civicrm.org>
Wed, 27 Jan 2016 21:51:34 +0000 (16:51 -0500)
templates/CRM/Core/BillingBlock.tpl
templates/CRM/Financial/Form/PaypalExpress.tpl

index adc489308d35152fe9fdb2630278404898e524dd..b6d0e67e4bf8725402bf677c8b4e520d1acb4477 100644 (file)
                 .replace(/-/g, '');
         $('#credit_card_number').val(cc);
       });
-
-      function toggleConfirmButton() {
-        var suppressSubmitButton = {/literal}"{$suppressSubmitButton}"{literal};
-        $("#crm-submit-buttons").toggle(!suppressSubmitButton);
-      }
-      toggleConfirmButton();
-      $('input[name="payment_processor_id"]').change(toggleConfirmButton);
     });
 
   </script>
   {/literal}
 {/if}
+{if $suppressSubmitButton}
+{literal}
+  <script type="text/javascript">
+    CRM.$(function($) {
+      $('.crm-submit-buttons', $('#billing-payment-block').closest('form')).hide();
+    });
+  </script>
+{/literal}
+{/if}
 {/crmRegion}
 {crmRegion name="billing-block-post"}
   {* Payment processors sometimes need to append something to the end of the billing block. We create a region for
index 80c8ca9493de2dda538708e6e883cae6b2904549..c13c69b5eb329dc0eb4b97513991e1c5176ec79f 100644 (file)
       </div>
     </fieldset>
   </div>
-{literal}
-  <script type="text/javascript">
-    CRM.$(function($) {
-      var $form = $('#billing-payment-block').closest('form');
-      $('.crm-submit-buttons', $form).hide();
-    });
-  </script>
-{/literal}