Skip to content

Commit

Permalink
CRM-21849: Include data in event after enable/disable
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mickadoo committed Apr 16, 2018
1 parent b277f8d commit a2f1945
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion templates/CRM/common/enableDisableApi.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit a2f1945

Please sign in to comment.