X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=js%2Fcrm.livePage.js;h=35c8b39312dd7cc3a333c4d5dc255b364798e929;hb=9ac4f6998bc411f30a94d7764140f6bcd7decaf7;hp=a47145cb41b037909d7d4cd203962f252f5864c1;hpb=8c01223211821aa94056d5e6c26a154af3492d20;p=civicrm-core.git diff --git a/js/crm.livePage.js b/js/crm.livePage.js index a47145cb41..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 - .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); });