1 // http://civicrm.org/licensing
3 $('.crm-contribution-pcp-block').hide();
4 $('#showPCP, #showSoftCredit').click(function(){
5 return showHideSoftCreditAndPCP();
8 function showHideSoftCreditAndPCP() {
9 $('.crm-contribution-pcp-block').toggle();
10 $('.crm-contribution-pcp-block-link').toggle();
11 $('.crm-contribution-form-block-soft_credit_to').toggle();
15 $('#addMoreSoftCredit').click(function(){
16 $('.crm-soft-credit-block tr.hiddenElement :first').show().removeClass('hiddenElement');
17 if ( $('.crm-soft-credit-block tr.hiddenElement').length
< 1 ) {
18 $('#addMoreSoftCredit').hide();
23 var pcpURL
= CRM
.url('civicrm/ajax/rest',
24 'className=CRM_Contact_Page_AJAX&fnName=getPCPList&json=1&context=contact&reset=1');
25 $('#pcp_made_through').autocomplete(pcpURL
,
26 { width
: 360, selectFirst
: false, matchContains
: true
27 }).result( function(event
, data
, formatted
) {
28 cj( "#pcp_made_through_id" ).val( data
[1] );