Commit 397b8ffc authored by Sandro Lutz's avatar Sandro Lutz
Browse files

Keep menu visible if item has submenu (fixes #47)

parent 7d185e86
......@@ -6,9 +6,12 @@ import { i18n, currentLanguage, switchLanguage } from '../models/language';
import { Button } from '../components';
import { isLoggedIn, login } from '../models/auth';
let mobileMenuShowing = false;
export default class Header {
oninit() {
this._mobileMenuShowing = false;
this._mobileMenuShowing = mobileMenuShowing;
mobileMenuShowing = false;
}
// eslint-disable-next-line class-methods-use-this
......@@ -70,7 +73,15 @@ export default class Header {
'a',
{
href: item.getLink(),
onupdate: item.onupdate,
onclick: e => {
if (item.submenu) {
mobileMenuShowing = true;
}
if (item.getLink().startsWith('/')) {
m.route.set(item.getLink());
e.preventDefault();
}
},
},
i18n(item.label)
),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment