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>${formatDuration(trip.duration_seconds)}</td>
|
||||||
<td>${formatSpeed(trip.max_speed_kmh)}</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-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">
|
<td class="text-end text-nowrap d-none d-sm-table-cell">${deleteBtn}</td>`;
|
||||||
<button class="btn btn-sm btn-primary" type="button" data-trip-id="${trip.id}">
|
|
||||||
Replay
|
|
||||||
</button>${deleteBtn}
|
|
||||||
</td>`;
|
|
||||||
body.appendChild(row);
|
body.appendChild(row);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -352,13 +348,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Replay button click (desktop) or row click (mobile) — debounced
|
// Row click triggers replay — debounced
|
||||||
const tripId = button ? button.dataset.tripId : (row ? row.dataset.tripId : null);
|
const row = event.target.closest("tr[data-trip-id]");
|
||||||
if (!tripId) return;
|
if (!row) return;
|
||||||
|
const tripId = row.dataset.tripId;
|
||||||
clearTimeout(_replayDebounce);
|
clearTimeout(_replayDebounce);
|
||||||
_replayDebounce = setTimeout(() => {
|
_replayDebounce = setTimeout(() => replayTrip(tripId), 100);
|
||||||
replayTrip(tripId);
|
|
||||||
}, 100);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
scrubber.addEventListener("input", function () {
|
scrubber.addEventListener("input", function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user