Files
breadcrumb-the-shire/modules/helpdesk/web/js/helpdesk-clickable-rows.js
fs a0d7670dd7 feat(helpdesk): align module with core list/drawer standards
- add helpdesk module pages, services, settings and tests

- standardize debtor list on drawer/grid contracts and robust filter drawer behavior

- add helpdesk aside panel navigation and settings visibility provider

- switch primary list slug to helpdesk/debitor and remove helpdesk/search compatibility

- include required core contract updates for list contracts and detail/drawer integration
2026-04-02 17:48:27 +02:00

30 lines
748 B
JavaScript

/**
* Shared clickable-row behaviour for helpdesk tables.
* Navigates to `data-href` on click or Enter/Space key.
*/
export function initClickableRows() {
const rows = document.querySelectorAll('.app-clickable-row[data-href]');
rows.forEach((row) => {
row.addEventListener('click', (event) => {
if (event.target.closest('a')) {
return;
}
const href = row.dataset.href;
if (href) {
window.location.href = href;
}
});
row.addEventListener('keydown', (event) => {
if (event.key === 'Enter' || event.key === ' ') {
event.preventDefault();
const href = row.dataset.href;
if (href) {
window.location.href = href;
}
}
});
});
}