Full track table editing
This commit is contained in:
parent
103ad57ddc
commit
e9cf2bc849
@ -122,18 +122,46 @@
|
|||||||
<td class="px-6 py-4 whitespace-nowrap">
|
<td class="px-6 py-4 whitespace-nowrap">
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<div class="ml-4">
|
<div class="ml-4">
|
||||||
|
{#if editTracks.findIndex((tr) => tr.id === t.id) !== -1}
|
||||||
|
<input
|
||||||
|
class="shadow-sm rounded-l-md sm:text-sm border-gray-300 border bg-gray-50 text-gray-500 rounded-md p-0.5"
|
||||||
|
type="number"
|
||||||
|
value={t.distance}
|
||||||
|
on:input={(e) => {
|
||||||
|
const i = editTracks.findIndex(
|
||||||
|
(tr) => tr.id === t.id
|
||||||
|
);
|
||||||
|
editTracks[i].distance = parseInt(e.target.value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
{:else}
|
||||||
<div class="text-sm font-medium text-gray-900">
|
<div class="text-sm font-medium text-gray-900">
|
||||||
{t.distance}
|
{t.distance}
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="px-6 py-4 whitespace-nowrap">
|
<td class="px-6 py-4 whitespace-nowrap">
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<div class="ml-4">
|
<div class="ml-4">
|
||||||
|
{#if editTracks.findIndex((tr) => tr.id === t.id) !== -1}
|
||||||
|
<input
|
||||||
|
class="shadow-sm rounded-l-md sm:text-sm border-gray-300 border bg-gray-50 text-gray-500 rounded-md p-0.5"
|
||||||
|
type="number"
|
||||||
|
value={t.minimumLapTime}
|
||||||
|
on:input={(e) => {
|
||||||
|
const i = editTracks.findIndex(
|
||||||
|
(tr) => tr.id === t.id
|
||||||
|
);
|
||||||
|
editTracks[i].minimumLapTime = parseInt(e.target.value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
{:else}
|
||||||
<div class="text-sm font-medium text-gray-900">
|
<div class="text-sm font-medium text-gray-900">
|
||||||
{t.minimumLapTime}
|
{t.minimumLapTime}
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user