Skip to content

Commit

Permalink
Follow-up fix for dynamic field UUID support in dialog AdminNotificat…
Browse files Browse the repository at this point in the history
…ionEvent.
  • Loading branch information
jepf committed Jul 23, 2024
1 parent 928ab59 commit 4519c1b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions var/httpd/htdocs/js/Core.Agent.Admin.NotificationEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,11 @@ Core.Agent.Admin.NotificationEvent = (function (TargetNS) {
Core.Config.Get('CGIHandle'),
Data,
function (Response) {
var FieldHTML = Response.Label + '<div class="Field flex-row" data-id="' + Response.ID + '">' + Response.Field;
var $Field = $(Response.Label + '<div class="Field flex-row" data-id="' + Response.ID + '">' + Response.Field),
InputFieldUUID = $Field.find(':input').attr('data-input-field-uuid');

// Append field HTML from response to selected fields area.
$('#' + SelectedFieldsID).append(FieldHTML);
$('#' + SelectedFieldsID).append($Field);
$('div.Field[data-id="' + Response.ID + '"]').append(RemoveButtonHTML);

TargetNS.InitRemoveButtonEvent($('div.Field[data-id="' + Response.ID + '"]').find('.RemoveButton'), AddFieldsID);
Expand All @@ -200,7 +201,9 @@ Core.Agent.Admin.NotificationEvent = (function (TargetNS) {
});

// Trigger dynamic field event initialization (needed for specific fields from packages).
Core.App.Publish('Event.DynamicField.Init', [Response.ID]);
if (InputFieldUUID) {
Core.App.Publish('Event.DynamicField.InitByInputFieldUUID', [InputFieldUUID]);
}

return false;

Expand Down

0 comments on commit 4519c1b

Please sign in to comment.