Bug 37912: Restore detail-trigger handling

This patch converts our jQuery based click to native JS and restores the
bootstrap modal button click trigger handling.

Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Martin Renvoize 2024-10-29 15:16:42 +00:00 committed by Katrin Fischer
parent f9bfb4d0ca
commit 93be319372
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 14 additions and 5 deletions

View File

@ -1,11 +1,20 @@
/* keep tidy */
$(document).ready(function () {
$("#table_concerns").on("click", ".detail-trigger", function () {
// Find the main trigger anchor within the same table row
var $mainTrigger = $(this).closest("tr").find(".main-trigger");
document.addEventListener("click", function (event) {
const detailTrigger = event.target.closest(".detail-trigger");
if (detailTrigger) {
event.preventDefault();
// Trigger the click event of the main trigger anchor
$mainTrigger.trigger("click");
// Find the main trigger button in the same row
const mainTrigger = detailTrigger
.closest("tr")
.querySelector(".main-trigger");
// Trigger a click on the main trigger if it exists
if (mainTrigger) {
mainTrigger.click();
}
}
});
$("#ticketDetailsModal").on("show.bs.modal", function (event) {