'use strict';


function togglePrivacyQuestionsAnsweredStatusField(){
    let privacyQuestionsStatusContainer = $('.privacy-questions-container');
    let privacyQuestionsEnabledCheckbox = $(".privacy-questions-toggle");
    if (privacyQuestionsEnabledCheckbox.is(':checked')) {
        privacyQuestionsStatusContainer.find('input[type="radio"]').prop('disabled', false);
    } else {
        privacyQuestionsStatusContainer.find('input[type="radio"]').prop('disabled', true);
    }
}

$(document).ready(function(){
    $(".privacy-questions-toggle").on('change', togglePrivacyQuestionsAnsweredStatusField);
    togglePrivacyQuestionsAnsweredStatusField();
});

'use strict';


function togglePrivacyQuestionsAnsweredStatusField(){
    let privacyQuestionsStatusContainer = $('.privacy-questions-container');
    let privacyQuestionsEnabledCheckbox = $(".privacy-questions-toggle");
    if (privacyQuestionsEnabledCheckbox.is(':checked')) {
        privacyQuestionsStatusContainer.parent().show(200);
    } else {
        privacyQuestionsStatusContainer.parent().hide();
    }
}

$(document).ready(function(){
    $(".privacy-questions-toggle").on('change', togglePrivacyQuestionsAnsweredStatusField);
    togglePrivacyQuestionsAnsweredStatusField();
});

Change privacy question status behaviour
Change privacy question status behaviour

The privacy question service status field now is hidden when it is not
required (when the privacy questions are disabled). And they are
displayed in their disabled state when the toggle is enabled.
