CRM-15283 - Pledge form fixes
[civicrm-core.git] / templates / CRM / Pledge / Form / Selector.tpl
index 2dd8e9a3f994115822e969403c7b2c895fe2fab9..5b098166b5f297ba41d80c95102afba34e68769f 100644 (file)
 {* Build pledge payment details*}
 {literal}
 <script type="text/javascript">
-
-    function buildPaymentDetails( pledgeId, contactId )
-    {
-        var dataUrl = {/literal}"{crmURL p='civicrm/pledge/payment' h=0 q="action=browse&snippet=4&context=`$context`&pledgeId="}"{literal} + pledgeId + '&cid=' + contactId;
-        CRM.loadPage(dataUrl, {target: '#paymentDetails' + pledgeId});
-    }
+  (function($) {
+    // FIXME global function
+    window.buildPaymentDetails = function(pledgeId, contactId) {
+      var dataUrl = {/literal}"{crmURL p='civicrm/pledge/payment' h=0 q="action=browse&snippet=4&context=`$context`&pledgeId="}"{literal} + pledgeId + '&cid=' + contactId;
+      $('#paymentDetails' + pledgeId).load(dataUrl, function() {
+        $(this).trigger('crmLoad');
+      });
+    };
+  })(CRM.$);
 </script>
 {/literal}