diff --git a/modules/turnero/views/historial.php b/modules/turnero/views/historial.php index c067911..20fd54a 100644 --- a/modules/turnero/views/historial.php +++ b/modules/turnero/views/historial.php @@ -491,7 +491,8 @@ function renderTabla(turnos) { ` : ''; - return ` + return ` ${esc(fecha)} ${esc(t.codigo)} @@ -518,12 +519,12 @@ function renderTabla(turnos) { ${totMin} @@ -619,6 +620,22 @@ function renderDetalle(t) { `; } +/** + * Clic en cualquier parte de la fila: abre o cierra su detalle. + * + * Se ignora si el usuario estaba seleccionando texto —copiar un documento o un + * nombre es frecuente aquí y sería molesto que la fila se abriera al soltar— y + * si el clic cayó sobre un enlace o un botón, que tienen lo suyo que hacer. + */ +function filaDetalle(ev, rowId, turnoId) { + if (ev.target.closest('button, a, input, select')) return; + const sel = window.getSelection(); + if (sel && sel.toString().length > 0) return; + const fila = document.querySelector(`tr[data-id="${turnoId}"]`); + const btn = fila ? fila.querySelector('button[title="Ver detalles"]') : null; + if (btn) toggleDetalle(rowId, btn, turnoId); +} + function toggleDetalle(rowId, btn, turnoId) { const row = document.getElementById(rowId); const icon = btn.querySelector('i');