CRM-15278 - better handling of wysiwyg editors in popups
[civicrm-core.git] / js / crm.livePage.js
index 48a327c479b85c1cdfd36cab5f2834b864de637d..5133f5d37113e9ceda5e863f35304059ed47402a 100644 (file)
@@ -1,6 +1,6 @@
 // http://civicrm.org/licensing
 // Adds ajaxy behavior to a simple CiviCRM page
-cj(function($) {
+CRM.$(function($) {
   var active = 'a.button, a.action-item, a.crm-popup';
   $('#crm-main-content-wrapper')
     // Widgetize the content area
@@ -8,8 +8,5 @@ cj(function($) {
     // Open action links in a popup
     .off('.crmLivePage')
     .on('click.crmLivePage', active, CRM.popup)
-    .on('crmPopupFormSuccess.crmLivePage', active, function() {
-      // Refresh page when form completes
-      $('#crm-main-content-wrapper').crmSnippet('refresh');
-    });
+    .on('crmPopupFormSuccess.crmLivePage', active, CRM.refreshParent);
 });