window.actionBlockInit = function()
{
    if(repo.SCM != 'GitFox') return;

    $('#actionPicker' + window.triggerCount).addClass('form-group-wrapper picker-box');

    const options = Object.keys(actionList).map((action) => {
        return {value: action, text: actionList[action]};
    });
    new zui.Picker('#actionPicker' + window.triggerCount, {
        items:         options,
        name:         'triggerActions',
        required:     true,
        multiple:     true,
        defaultValue: job.triggerActions || ['pullreq_created', 'pullreq_branch_updated', 'pullreq_reopened']
    });
}

$(function()
{
    $('.linkage-fields.hidden').remove();

    if(job.triggerType.includes('action'))
    {
        setTimeout(() => {
            $('input[value="action"]').trigger('change');
        }, 100)
    }
});
