mirror of
https://codeberg.org/demostf/frontend.git
synced 2026-06-03 10:14:13 +02:00
close menu when picking an item
This commit is contained in:
parent
97a6b46879
commit
2c7702464b
1 changed files with 11 additions and 4 deletions
|
|
@ -13,8 +13,14 @@ export interface AnalyseMenuProps {
|
|||
}
|
||||
|
||||
export function AnalyseMenu(props: AnalyseMenuProps) {
|
||||
let details;
|
||||
const loc = () => window.location.toString().replace(/\#.*/, '') + '#' + props.sessionName;
|
||||
|
||||
const openModal = (modal: ModalState) => {
|
||||
details.open = false;
|
||||
props.openModal(modal);
|
||||
}
|
||||
|
||||
return (<div class="analyse-menu">
|
||||
<Show when={props.inShared}>
|
||||
<div class="share shared">
|
||||
|
|
@ -22,12 +28,13 @@ export function AnalyseMenu(props: AnalyseMenuProps) {
|
|||
</div>
|
||||
</Show>
|
||||
<Show when={!props.inShared}>
|
||||
<details>
|
||||
<details ref={details}>
|
||||
<summary title="Menu">☰</summary>
|
||||
<ul class="menu">
|
||||
<li>
|
||||
<button className="share-session" title="Start a shared session" disabled={props.isShared}
|
||||
onClick={() => {
|
||||
details.open = false;
|
||||
props.onShare()
|
||||
}}>
|
||||
<Show when={!props.isShared}>
|
||||
|
|
@ -44,18 +51,18 @@ export function AnalyseMenu(props: AnalyseMenuProps) {
|
|||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button className="help" title="Help" onClick={() => props.openModal(ModalState.Help)}>
|
||||
<button className="help" title="Help" onClick={() => openModal(ModalState.Help)}>
|
||||
Help
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button className="goto" title="Goto Tick" onClick={() => props.openModal(ModalState.Goto)}>
|
||||
<button className="goto" title="Goto Tick" onClick={() => openModal(ModalState.Goto)}>
|
||||
Goto Tick
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button className="search" title="Search Events"
|
||||
onClick={() => props.openModal(ModalState.Search)}>
|
||||
onClick={() => openModal(ModalState.Search)}>
|
||||
Search Events
|
||||
</button>
|
||||
</li>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue