diff --git a/src/pages/header/Header.svelte b/src/pages/header/Header.svelte index be25af657..42e57fd6c 100644 --- a/src/pages/header/Header.svelte +++ b/src/pages/header/Header.svelte @@ -4,6 +4,7 @@ import * as Navigation from '@Utility/navigation'; import * as Kayttajat from '@Utility/kayttajat'; + import * as keys from '@Utility/keys'; import { _ } from '@Language/i18n'; import LanguageSelect from './language-select'; @@ -16,6 +17,15 @@ let nameNode; let ohjeNode; + const toggleNameDropdown = () => (showNameDropdown = !showNameDropdown); + const toggleOhjeDropdown = () => (showOhjeDropdown = !showOhjeDropdown); + + const enterHandler = handler => e => { + if (e.keyCode === keys.ENTER) { + handler(); + } + }; + const fullName = kayttaja => `${kayttaja.etunimi} ${kayttaja.sukunimi}`; $: links = R.compose( @@ -99,8 +109,10 @@