{*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
<script type="text/javascript">
function buildPaymentBlock( type ) {
- if ( type == 0 ) {
- if (cj("#billing-payment-block").length) {
- cj("#billing-payment-block").html('');
- }
- return;
+ {/literal}{if !$isBillingAddressRequiredForPayLater}{literal}
+ if (type == 0) {
+ if (cj("#billing-payment-block").length) {
+ cj("#billing-payment-block").html('');
}
+ return;
+ }
+ {/literal}{/if}{literal}
var dataUrl = {/literal}"{crmURL p=$urlPath h=0 q='snippet=4&type='}"{literal} + type;
{/if}
{literal}
- var fname = '#billing-payment-block';
var response = cj.ajax({
url: dataUrl,
async: false
}).responseText;
- cj( fname ).html( response );
+ cj('#billing-payment-block').html(response).trigger('crmLoad').trigger('crmFormLoad');
}
-cj( function() {
- cj('.crm-group.payment_options-group').show();
+CRM.$(function($) {
+ $('.crm-group.payment_options-group').show();
- cj('input[name="payment_processor"]').change( function() {
- buildPaymentBlock( cj(this).val() );
+ $('input[name="payment_processor"]').change( function() {
+ buildPaymentBlock( $(this).val() );
});
});