mirror of
https://codeberg.org/demostf/frontend.git
synced 2026-06-03 18:24:12 +02:00
allow clicking on event search items
This commit is contained in:
parent
72c4b6ee08
commit
0112af009e
2 changed files with 6 additions and 3 deletions
|
|
@ -49,7 +49,8 @@ export function EventSearch(props: EventSearchProps) {
|
||||||
onInput={(e) => props.onSearch(e.target.value)}/>
|
onInput={(e) => props.onSearch(e.target.value)}/>
|
||||||
<table class="event-list">
|
<table class="event-list">
|
||||||
<For each={events()}>{(event, i) =>
|
<For each={events()}>{(event, i) =>
|
||||||
<EventView event={event} highlighted={i() == selected()} players={props.players}/>
|
<EventView event={event} highlighted={i() == selected()} players={props.players}
|
||||||
|
onClick={() => props.onSelect(event)}/>
|
||||||
}</For>
|
}</For>
|
||||||
</table>
|
</table>
|
||||||
</div>)
|
</div>)
|
||||||
|
|
@ -59,6 +60,7 @@ interface EventViewProps {
|
||||||
event: Event;
|
event: Event;
|
||||||
highlighted: boolean,
|
highlighted: boolean,
|
||||||
players: PlayerState[];
|
players: PlayerState[];
|
||||||
|
onClick: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
function EventView(props: EventViewProps) {
|
function EventView(props: EventViewProps) {
|
||||||
|
|
@ -70,7 +72,7 @@ function EventView(props: EventViewProps) {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return (
|
return (
|
||||||
<tr ref={row} class={props.event.type + highlightClass()}>
|
<tr ref={row} class={props.event.type + highlightClass()} onClick={() => props.onClick()}>
|
||||||
<Show when={props.event.type == "kill"}>
|
<Show when={props.event.type == "kill"}>
|
||||||
<KillView kill={props.event.kill} players={props.players}/>
|
<KillView kill={props.event.kill} players={props.players}/>
|
||||||
</Show>
|
</Show>
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,12 @@ table.event-list {
|
||||||
line-height: 34px;
|
line-height: 34px;
|
||||||
table-layout: fixed;
|
table-layout: fixed;
|
||||||
|
|
||||||
tr.highlighted {
|
tr.highlighted, tr:hover {
|
||||||
background: #3a3a3a;
|
background: #3a3a3a;
|
||||||
}
|
}
|
||||||
|
|
||||||
td {
|
td {
|
||||||
|
cursor: pointer;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
padding: 0 3px;
|
padding: 0 3px;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue