mirror of
https://codeberg.org/demostf/frontend.git
synced 2026-06-03 18:24:12 +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) {
|
export function AnalyseMenu(props: AnalyseMenuProps) {
|
||||||
|
let details;
|
||||||
const loc = () => window.location.toString().replace(/\#.*/, '') + '#' + props.sessionName;
|
const loc = () => window.location.toString().replace(/\#.*/, '') + '#' + props.sessionName;
|
||||||
|
|
||||||
|
const openModal = (modal: ModalState) => {
|
||||||
|
details.open = false;
|
||||||
|
props.openModal(modal);
|
||||||
|
}
|
||||||
|
|
||||||
return (<div class="analyse-menu">
|
return (<div class="analyse-menu">
|
||||||
<Show when={props.inShared}>
|
<Show when={props.inShared}>
|
||||||
<div class="share shared">
|
<div class="share shared">
|
||||||
|
|
@ -22,12 +28,13 @@ export function AnalyseMenu(props: AnalyseMenuProps) {
|
||||||
</div>
|
</div>
|
||||||
</Show>
|
</Show>
|
||||||
<Show when={!props.inShared}>
|
<Show when={!props.inShared}>
|
||||||
<details>
|
<details ref={details}>
|
||||||
<summary title="Menu">☰</summary>
|
<summary title="Menu">☰</summary>
|
||||||
<ul class="menu">
|
<ul class="menu">
|
||||||
<li>
|
<li>
|
||||||
<button className="share-session" title="Start a shared session" disabled={props.isShared}
|
<button className="share-session" title="Start a shared session" disabled={props.isShared}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
details.open = false;
|
||||||
props.onShare()
|
props.onShare()
|
||||||
}}>
|
}}>
|
||||||
<Show when={!props.isShared}>
|
<Show when={!props.isShared}>
|
||||||
|
|
@ -44,18 +51,18 @@ export function AnalyseMenu(props: AnalyseMenuProps) {
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<button className="help" title="Help" onClick={() => props.openModal(ModalState.Help)}>
|
<button className="help" title="Help" onClick={() => openModal(ModalState.Help)}>
|
||||||
Help
|
Help
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
<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
|
Goto Tick
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<button className="search" title="Search Events"
|
<button className="search" title="Search Events"
|
||||||
onClick={() => props.openModal(ModalState.Search)}>
|
onClick={() => openModal(ModalState.Search)}>
|
||||||
Search Events
|
Search Events
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue