CRM-13965-qa-fixes
[civicrm-core.git] / js / crm.livePage.js
index 0d313b3af6451b9a02022f85f793d375899dcba8..dff3beff868df33ca65998617181205e7ebf906d 100644 (file)
@@ -5,9 +5,15 @@ cj(function($) {
     // 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'
+    .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');