Bug 41001: Remove messages when dialog closes, even if not through the close button

This ensures that when the dialog is closed, even when clicked outside of it, the messages are correctly removed, same as if the 'close' button had been clicked.

Test plan:
- create a data ERM provider /cgi-bin/koha/erm/eusage/usage_data_providers/add
- dummy data should be sufficient
- then go to data providers list /cgi-bin/koha/erm/eusage/usage_data_provider
- open web development tools console (F12 firefox)
- click on "Run now"
- dismiss dialog by clicking outside the modal!
- click again on "Run now"
- check the logs for errors
- any other clicks to create a modal won't work now ("run now", "delete")

Apply patch. run yarn js:watch or yarn js:build. Repeat.

Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
This commit is contained in:
Pedro Amorim 2025-09-30 14:21:15 +00:00 committed by Laura Escamilla
parent 0b96b498e3
commit 3908b7bc1c
No known key found for this signature in database
GPG Key ID: B5DEB5FD2FCDA5D8
1 changed files with 6 additions and 0 deletions

View File

@ -164,6 +164,9 @@ export default {
return;
}
nextTick(() => {
$("#warning.modal").on("hidden.bs.modal", function () {
removeMessages();
});
$("#warning.modal").modal("show");
});
});
@ -174,6 +177,9 @@ export default {
return;
}
nextTick(() => {
$("#confirmation.modal").on("hidden.bs.modal", function () {
removeConfirmationMessages();
});
$("#confirmation.modal").modal("show");
});
});