fix(phase26): fix broken click handler, remove replay button, row click only
This commit is contained in:
+6
-11
@@ -314,11 +314,7 @@
|
||||
<td>${formatDuration(trip.duration_seconds)}</td>
|
||||
<td>${formatSpeed(trip.max_speed_kmh)}</td>
|
||||
<td class="text-muted small">${trip.odo_start_km != null ? trip.odo_start_km.toFixed(0) + ' → ' + trip.odo_end_km.toFixed(0) + ' km' : '—'}</td>
|
||||
<td class="text-end text-nowrap d-none d-sm-table-cell">
|
||||
<button class="btn btn-sm btn-primary" type="button" data-trip-id="${trip.id}">
|
||||
Replay
|
||||
</button>${deleteBtn}
|
||||
</td>`;
|
||||
<td class="text-end text-nowrap d-none d-sm-table-cell">${deleteBtn}</td>`;
|
||||
body.appendChild(row);
|
||||
});
|
||||
|
||||
@@ -352,13 +348,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Replay button click (desktop) or row click (mobile) — debounced
|
||||
const tripId = button ? button.dataset.tripId : (row ? row.dataset.tripId : null);
|
||||
if (!tripId) return;
|
||||
// Row click triggers replay — debounced
|
||||
const row = event.target.closest("tr[data-trip-id]");
|
||||
if (!row) return;
|
||||
const tripId = row.dataset.tripId;
|
||||
clearTimeout(_replayDebounce);
|
||||
_replayDebounce = setTimeout(() => {
|
||||
replayTrip(tripId);
|
||||
}, 100);
|
||||
_replayDebounce = setTimeout(() => replayTrip(tripId), 100);
|
||||
});
|
||||
|
||||
scrubber.addEventListener("input", function () {
|
||||
|
||||
Reference in New Issue
Block a user