Merge pull request #3119 from pradpnayak/CRM-14380
[civicrm-core.git] / templates / CRM / common / customData.tpl
index 941003430c5f5871545e8dc97b00226a4cd141a8..64ed2fa60e196942ca54d765b2687074b3ffad12 100644 (file)
@@ -1,8 +1,8 @@
 {*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.4                                                |
+ | CiviCRM version 4.5                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
+ | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -29,9 +29,7 @@
 {/if}
 {literal}
 <script type="text/javascript">
-var CRM = CRM || {};
-CRM.buildCustomData = function( type, subType, subName, cgCount, groupID, isMultiple )
-{
+CRM.buildCustomData = function( type, subType, subName, cgCount, groupID, isMultiple ) {
   var dataUrl = {/literal}"{crmURL p=$urlPath h=0 q='snippet=4&type='}"{literal} + type;
 
   if ( subType ) {
@@ -108,12 +106,12 @@ CRM.buildCustomData = function( type, subType, subName, cgCount, groupID, isMult
           cj('textarea', this).each(function() {
             cj(this).text(cj(this).val());
           });
-          cj('option:selected', this).prop('selected', true);
-          cj('option:not(:selected)', this).prop('selected', false);
+          cj('option:selected', this).attr('selected', 'selected');
+          cj('option:not(:selected)', this).removeAttr('selected');
           storage[id] = cj(this).detach();
         }
       });
-      target.html(response);
+      target.html(response).trigger('crmLoad');
       target.children().each(function() {
         var id = cj(this).attr('id');
         if (id && storage[id]) {