X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=js%2Fcrm.livePage.js;h=5133f5d37113e9ceda5e863f35304059ed47402a;hb=66663184e286093a2eb87adccfbacc618898bb62;hp=dff3beff868df33ca65998617181205e7ebf906d;hpb=a055fd3bcb8341e6a9c25e32432cf4f4776a2781;p=civicrm-core.git diff --git a/js/crm.livePage.js b/js/crm.livePage.js index dff3beff86..5133f5d371 100644 --- a/js/crm.livePage.js +++ b/js/crm.livePage.js @@ -1,23 +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, 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, { - openInline: 'a:not("[href=#], .no-popup")' - }).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); });