From a2f1945a81ef562f6ad0a4bf79cde9d1807543de Mon Sep 17 00:00:00 2001 From: Michael Devery Date: Tue, 27 Mar 2018 16:06:09 +0100 Subject: [PATCH] CRM-21849: Include data in event after enable/disable The logic on whether to refresh the available options in CRM.popup depends on whether the crmPopupFormSuccess returned data. The data provided here is arbitrary but could be useful in the future for anyone reacting to the event --- templates/CRM/common/enableDisableApi.tpl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/templates/CRM/common/enableDisableApi.tpl b/templates/CRM/common/enableDisableApi.tpl index ed9f284247..8ab4bc889a 100644 --- a/templates/CRM/common/enableDisableApi.tpl +++ b/templates/CRM/common/enableDisableApi.tpl @@ -36,7 +36,13 @@ } 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); } -- 2.25.1