X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=js%2Fcrm.livePage.js;h=35c8b39312dd7cc3a333c4d5dc255b364798e929;hb=f5e2d79934502b8d28a8e9a8f1c31f9af0e1c7a1;hp=0d313b3af6451b9a02022f85f793d375899dcba8;hpb=3ca50f32650eb7a063fa728284cd9a40619f9b6f;p=civicrm-core.git diff --git a/js/crm.livePage.js b/js/crm.livePage.js index 0d313b3af6..35c8b39312 100644 --- a/js/crm.livePage.js +++ b/js/crm.livePage.js @@ -1,17 +1,12 @@ // 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 - .on('click', 'a.button, a.action-item:not(".enable-action, .disable-action")', function() { - CRM.loadForm($(this).attr('href'), { - openInline: 'a' - }).on('crmFormSuccess', function(e, data) { - // Refresh page when form completes - $('#crm-main-content-wrapper').crmSnippet('refresh'); - }); - return false; - }); + .off('.crmLivePage') + .on('click.crmLivePage', active, CRM.popup) + .on('crmPopupFormSuccess.crmLivePage', active, CRM.refreshParent); });