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)}/>
|
||||
<table class="event-list">
|
||||
<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>
|
||||
</table>
|
||||
</div>)
|
||||
|
|
@ -59,6 +60,7 @@ interface EventViewProps {
|
|||
event: Event;
|
||||
highlighted: boolean,
|
||||
players: PlayerState[];
|
||||
onClick: () => void;
|
||||
}
|
||||
|
||||
function EventView(props: EventViewProps) {
|
||||
|
|
@ -70,7 +72,7 @@ function EventView(props: EventViewProps) {
|
|||
}
|
||||
})
|
||||
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"}>
|
||||
<KillView kill={props.event.kill} players={props.players}/>
|
||||
</Show>
|
||||
|
|
|
|||
|
|
@ -13,11 +13,12 @@ table.event-list {
|
|||
line-height: 34px;
|
||||
table-layout: fixed;
|
||||
|
||||
tr.highlighted {
|
||||
tr.highlighted, tr:hover {
|
||||
background: #3a3a3a;
|
||||
}
|
||||
|
||||
td {
|
||||
cursor: pointer;
|
||||
vertical-align: top;
|
||||
padding: 0 3px;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue