Merge pull request #5822 from eileenmcnaughton/tests
[civicrm-core.git] / templates / CRM / Contribute / Form / SoftCredit.tpl
index 71dc72fdeafcaa653d4f221394f14c4047de43be..d78bdb1f89729f929f95505007c7ef8f3b1a33c0 100644 (file)
@@ -1,8 +1,8 @@
 {*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -59,7 +59,7 @@
   {/section}
   <tr>
     <td>
-      <a href="#" class="crm-hover-button" id="addMoreSoftCredit"><span class="icon add-icon"></span> {ts}another soft credit{/ts}</a>
+      <a href="#" class="crm-hover-button" id="addMoreSoftCredit"><span class="icon ui-icon-circle-plus"></span> {ts}another soft credit{/ts}</a>
     </td>
   </tr>
 </table>
       return false;
     });
 
-    $('input[name^="soft_credit_contact["]').change(function(){
-      var rowNum = $(this).prop('id').replace('soft_credit_contact_','');
+    $('input[name^="soft_credit_contact_"]').on('change', function(){
+      var rowNum = $(this).prop('id').replace('soft_credit_contact_id_','');
       var totalAmount = $('#total_amount').val();
       //assign total amount as default soft credit amount
       $('#soft_credit_amount_'+ rowNum).val(totalAmount);
       var thousandMarker = {/literal}{$config->monetaryThousandSeparator|json_encode}{literal};
-      $('#soft_credit_type_'+ rowNum).val($('#sct_default_id').val());
+      $('#soft_credit_type_'+ rowNum).select2('val', $('#sct_default_id').val());
       totalAmount = Number(totalAmount.replace(thousandMarker,''));
       if (rowNum > 1) {
         var scAmount = Number($('#soft_credit_amount_'+ (rowNum - 1)).val().replace(thousandMarker,''));