From 0beed86b3fa1e68bfdbbcc5ad01d5e56845e198c Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Wed, 14 Sep 2022 12:01:46 +0200 Subject: [PATCH] The provider checkboxes must be disabled after the page renders --- assets/js/pages/secretaries.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/assets/js/pages/secretaries.js b/assets/js/pages/secretaries.js index ef1bab66..2b711da6 100644 --- a/assets/js/pages/secretaries.js +++ b/assets/js/pages/secretaries.js @@ -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) => { $('
', { 'class': 'checkbox', @@ -519,6 +515,10 @@ App.Pages.Secretaries = (function () { ] }).appendTo('#secretary-providers'); }); + + resetForm(); + filter(''); + addEventListeners(); } document.addEventListener('DOMContentLoaded', initialize);