From 1f2b6f2ff438be8ea914a431b0efa8198ec23d96 Mon Sep 17 00:00:00 2001 From: Tyler Schicke Date: Tue, 21 May 2019 19:16:07 -0400 Subject: Changes --- src/client/views/MainView.tsx | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx index aa34a12ed..af224747d 100644 --- a/src/client/views/MainView.tsx +++ b/src/client/views/MainView.tsx @@ -40,8 +40,6 @@ export class MainView extends React.Component { @observable private _workspacesShown: boolean = false; @observable public pwidth: number = 0; @observable public pheight: number = 0; - private searchbox: React.RefObject; - @computed private get mainContainer(): Opt { return FieldValue(Cast(CurrentUserUtils.UserDocument.activeWorkspace, Doc)); } @@ -57,7 +55,6 @@ export class MainView extends React.Component { constructor(props: Readonly<{}>) { super(props); MainView.Instance = this; - this.searchbox = React.createRef(); // causes errors to be generated when modifying an observable outside of an action configure({ enforceActions: "observed" }); if (window.location.search.includes("readonly")) { @@ -267,26 +264,17 @@ export class MainView extends React.Component { , -
, + this.isSearchVisible ?
: null,
]; } + @observable isSearchVisible = false; @action toggleSearch = () => { - const sb = this.searchbox.current; - if (sb !== null) { - console.log("toggle search") - if (sb.style.display === "none") { - sb.style.display = "block"; - } - else { - sb.style.display = "none"; - } - } - + this.isSearchVisible = !this.isSearchVisible; } render() { -- cgit v1.2.3-70-g09d2