forked from fa/breadcrumb-the-shire
- 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
30 lines
748 B
JavaScript
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;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|