diff --git a/plinth/modules/users/static/users.js b/plinth/modules/users/static/users.js index 8f4e4c0c3..c0b0dd836 100644 --- a/plinth/modules/users/static/users.js +++ b/plinth/modules/users/static/users.js @@ -33,7 +33,11 @@ document.addEventListener('DOMContentLoaded', (event) => { }); var deleteConfirmed = false; - const modal = new bootstrap.Modal('#user-delete-confirm-dialog'); + const modalEl = document.querySelector('#user-delete-confirm-dialog'); + const modal = new bootstrap.Modal(modalEl); + + // Make the user edit submit button clickable again when closing modal + modalEl.addEventListener('hide.bs.modal', clearButtonDisabling); // Show the confirmation dialog if the delete checkbox is selected function onUserUpdateSubmit(event) { diff --git a/static/themes/default/js/main.js b/static/themes/default/js/main.js index eaeb86b03..07c533a69 100644 --- a/static/themes/default/js/main.js +++ b/static/themes/default/js/main.js @@ -113,11 +113,10 @@ document.addEventListener('DOMContentLoaded', function(event) { } }); -// When using back/forward browser's bfcache is used and pages won't receive -// 'load' events. Instead a 'pageshow' event is available. When a user does -// back/forward we want them to be able to submit the forms again. So clear all -// the button disabling. -window.addEventListener('pageshow', function(event) { +/* + * Clear button disabling on the page. + */ +function clearButtonDisabling(event) { for (const button of getSubmitButtons()) { button.classList.remove('running-status-button'); if (button.classList.contains('temporarily-disabled')) { @@ -131,7 +130,13 @@ window.addEventListener('pageshow', function(event) { for (const element of beforeElements) { element.remove(); } -}); +}; + +// When using back/forward browser's bfcache is used and pages won't receive +// 'load' events. Instead a 'pageshow' event is available. When a user does +// back/forward we want them to be able to submit the forms again. So clear all +// the button disabling. +window.addEventListener('pageshow', clearButtonDisabling); /* * Select all option for multiple checkboxes.