The provider checkboxes must be disabled after the page renders

This commit is contained in:
Alex Tselegidis 2022-09-14 12:01:46 +02:00
parent db31e7deb8
commit 0beed86b3f

View file

@ -353,7 +353,7 @@ App.Pages.Secretaries = (function () {
$secretaries.find('.form-message').hide();
$secretaries.find('.is-invalid').removeClass('is-invalid');
$('#edit-secretary, #delete-secretary').prop('disabled', true);
$('#secretary-providers input:checkbox').prop('checked', false);
$('#secretary-providers input:checkbox').prop('disabled', true).prop('checked', false);
}
/**
@ -493,10 +493,6 @@ App.Pages.Secretaries = (function () {
* Initialize the module.
*/
function initialize() {
resetForm();
filter('');
addEventListeners();
vars('providers').forEach((provider) => {
$('<div/>', {
'class': 'checkbox',
@ -519,6 +515,10 @@ App.Pages.Secretaries = (function () {
]
}).appendTo('#secretary-providers');
});
resetForm();
filter('');
addEventListeners();
}
document.addEventListener('DOMContentLoaded', initialize);