// http://civicrm.org/licensing
// Adds ajaxy behavior to a simple CiviCRM page
-cj(function($) {
+CRM.$(function($) {
+ var active = 'a.button, a.action-item:not(.crm-enable-disable), a.crm-popup';
$('#crm-main-content-wrapper')
// Widgetize the content area
.crmSnippet()
// Open action links in a popup
- .off('click.crmLivePage')
- .on('click.crmLivePage', 'a.button, a.action-item', function() {
- return !$(this).crmPopup({
- crmFormSuccess: function() {
- // Refresh page when form completes
- $('#crm-main-content-wrapper').crmSnippet('refresh');
- }
- });
- });
+ .off('.crmLivePage')
+ .on('click.crmLivePage', active, CRM.popup)
+ .on('crmPopupFormSuccess.crmLivePage', active, CRM.refreshParent);
});