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