fix: move run navigation from id link to table row

This commit is contained in:
Anton
2026-05-07 17:03:36 +03:00
parent 1c4ad0bd9d
commit 7fa28e8e47
6 changed files with 31 additions and 9 deletions

View File

@@ -62,10 +62,20 @@
}
function setupClickableRows() {
const openRow = (row) => {
window.location.href = row.dataset.rowHref;
};
document.querySelectorAll("[data-row-href]").forEach((row) => {
row.addEventListener("click", (event) => {
if (event.target.closest("a, button, input, select, label")) return;
window.location.href = row.dataset.rowHref;
openRow(row);
});
row.addEventListener("keydown", (event) => {
if (!["Enter", " "].includes(event.key)) return;
if (event.target.closest("a, button, input, select, label")) return;
event.preventDefault();
openRow(row);
});
});
}