X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=js%2Fcrm.livePage.js;h=35c8b39312dd7cc3a333c4d5dc255b364798e929;hb=58cb13f8bfa693af1dcf19e5eb24e13d77da2d14;hp=ea355ffb5c991440f2d74d925212fdc4492d7545;hpb=e5267a0ef6ed6c651b6dbcc0fcc0a514b4e6e26e;p=civicrm-core.git diff --git a/js/crm.livePage.js b/js/crm.livePage.js index ea355ffb5c..35c8b39312 100644 --- a/js/crm.livePage.js +++ b/js/crm.livePage.js @@ -1,21 +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() { - var url = $(this).attr('href'); - // only follow real links not javascript buttons - if (url === '#' || $(this).attr('onclick') || $(this).hasClass('no-popup')) { - return; - } - CRM.loadForm(url).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); });