fix /analysis#menu shortcut

This commit is contained in:
Thibault Duplessis 2018-03-08 09:18:24 -05:00
parent 8fe9fda682
commit 3e23c56396
2 changed files with 3 additions and 9 deletions

View file

@ -123,15 +123,8 @@ function studyButton(ctrl: AnalyseCtrl) {
}
export class Ctrl {
open: boolean;
constructor() {
this.open = location.hash === '#menu';
}
toggle(): void {
this.open = !this.open;
}
open: boolean = false;
toggle = () => this.open = !this.open;
}
export function view(ctrl: AnalyseCtrl): VNode {

View file

@ -143,6 +143,7 @@ export default class AnalyseCtrl {
this.studyPractice = this.study ? this.study.practice : undefined;
if (location.hash === '#practice' || (this.study && this.study.data.chapter.practice)) this.togglePractice();
else if (location.hash === '#menu') li.requestIdleCallback(this.actionMenu.toggle);
keyboard.bind(this);