Bug 38222: (QA follow-up) DRY event listener setup for combobox resets on modal close

Sponsored-by: Büchereizentrale Schleswig-Holstein <https://www.bz-sh.de/>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Paul Derscheid 2024-10-25 07:41:07 +00:00 committed by Katrin Fischer
parent c297b9b10a
commit 878c78400c
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
4 changed files with 6 additions and 13 deletions

View File

@ -386,10 +386,6 @@
placeholder: _("Select or type a reason"),
});
document.getElementById("cancelBookingModal")?.addEventListener('hide.bs.modal', () => {
$("#cancellation-reason").comboBox('reset');
});
function handleFilter(e, text, filterStates) {
const target = e.target;
const { filter } = target.dataset;

View File

@ -1148,11 +1148,6 @@
displayProperty: 'name',
placeholder: _("Select or type a reason"),
});
document.getElementById("cancelBookingModal")?.addEventListener('hide.bs.modal', () => {
$("#cancellation-reason").comboBox('reset');
});
});
</script>
[% INCLUDE 'str/members-menu.inc' %]

View File

@ -832,10 +832,6 @@
displayProperty: 'name',
placeholder: _("Select or type a reason"),
});
document.getElementById("cancelBookingModal")?.addEventListener('hide.bs.modal', () => {
$("#cancellation-reason").comboBox('reset');
});
});
</script>
[% Asset.js("js/tables/bookings.js") | $raw %]

View File

@ -6,6 +6,12 @@
.getElementById("cancelBookingForm")
?.addEventListener("submit", handleSubmit);
document
.getElementById("cancelBookingModal")
?.addEventListener("hide.bs.modal", () => {
$("#cancellation-reason").comboBox("reset");
});
async function handleSubmit(e) {
e.preventDefault();