Merge pull request #14781 from civicrm/5.16
[civicrm-core.git] / templates / CRM / common / enableDisableApi.tpl
index ed9f284247a5b5984fc30f11d60e774779be6473..ae38fdba14447a2ad924c6b0d678e84b6205758f 100644 (file)
@@ -1,8 +1,8 @@
 {*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.7                                                |
+ | CiviCRM version 5                                                  |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2018                                |
+ | Copyright CiviCRM LLC (c) 2004-2019                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
     }
 
     function refresh() {
-      $a.trigger('crmPopupFormSuccess');
+      // the opposite of the current status based on row class
+      var newStatus = $row.hasClass('disabled');
+      $a.trigger('crmPopupFormSuccess', {
+        'entity': info.entity,
+        'id': info.id,
+        'enabled': newStatus
+      });
       CRM.refreshParent($row);
     }