aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/MainView.tsx
diff options
context:
space:
mode:
authormadelinegr <monika_hedman@brown.edu>2019-06-07 17:19:23 -0400
committermadelinegr <monika_hedman@brown.edu>2019-06-07 17:19:23 -0400
commit20da826f7bed4d3b6d9c7162af4f4fd6fb0f9048 (patch)
treebc90ce79f1d427aeef0c1426f972dfc28f0b6801 /src/client/views/MainView.tsx
parent90260099bc9b3fe6e786355baaa873d25c25476e (diff)
end of day 6/7
Diffstat (limited to 'src/client/views/MainView.tsx')
-rw-r--r--src/client/views/MainView.tsx13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx
index 5a6de6793..b3a0fde8d 100644
--- a/src/client/views/MainView.tsx
+++ b/src/client/views/MainView.tsx
@@ -60,6 +60,15 @@ export class MainView extends React.Component {
}
}
+ componentWillMount() {
+ document.removeEventListener("keydown", this.globalKeyHandler);
+ document.addEventListener("keydown", this.globalKeyHandler);
+ }
+
+ componentWillUnMount() {
+ document.removeEventListener("keydown", this.globalKeyHandler);
+ }
+
constructor(props: Readonly<{}>) {
super(props);
MainView.Instance = this;
@@ -317,8 +326,6 @@ export class MainView extends React.Component {
globalKeyHandler = (e: KeyboardEvent) => {
if (e.key === "Control" || !e.ctrlKey) return;
- console.log("keyevent");
-
e.preventDefault();
e.stopPropagation();
@@ -339,6 +346,8 @@ export class MainView extends React.Component {
case "escape":
_.mapValues(this.globalDisplayFlags, () => false)
break;
+ case "f":
+ this.isSearchVisible = !this.isSearchVisible;
}
}