@@ -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');