mirror of
https://codeberg.org/demostf/frontend.git
synced 2026-06-03 10:14:13 +02:00
make esc close modals
This commit is contained in:
parent
af40ad1aba
commit
9512e87226
1 changed files with 13 additions and 1 deletions
|
|
@ -33,28 +33,40 @@ export const Analyser = (props: AnalyseProps) => {
|
||||||
const [sessionName, setSessionName] = createSignal<string>("");
|
const [sessionName, setSessionName] = createSignal<string>("");
|
||||||
const [clients, setClients] = createSignal<number>(0);
|
const [clients, setClients] = createSignal<number>(0);
|
||||||
const [helpOpen, setHelpOpen] = createSignal<boolean>(false);
|
const [helpOpen, setHelpOpen] = createSignal<boolean>(false);
|
||||||
|
const closeDialogs = () => {
|
||||||
|
setHelpOpen(false);
|
||||||
|
};
|
||||||
|
|
||||||
createEffect(() => {
|
createEffect(() => {
|
||||||
const e = event();
|
const e = event();
|
||||||
|
|
||||||
untrack(() => {
|
untrack(() => {
|
||||||
|
console.log(e);
|
||||||
if (e) {
|
if (e) {
|
||||||
if (e.key === '.') {
|
if (e.key === '.') {
|
||||||
seek(1);
|
seek(1);
|
||||||
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
if (e.key === ',') {
|
if (e.key === ',') {
|
||||||
seek(-1);
|
seek(-1);
|
||||||
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
if (e.key === 'ArrowRight') {
|
if (e.key === 'ArrowRight') {
|
||||||
seek(15);
|
seek(15);
|
||||||
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
if (e.key === 'ArrowLeft') {
|
if (e.key === 'ArrowLeft') {
|
||||||
seek(-15);
|
seek(-15);
|
||||||
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
if (e.key === ' ') {
|
if (e.key === ' ') {
|
||||||
togglePlay();
|
togglePlay();
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
if (e.key === 'Escape') {
|
||||||
|
closeDialogs();
|
||||||
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
e.preventDefault();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue