From 2f1e56285750bcce6820ba2e1f24b7ad112b9db4 Mon Sep 17 00:00:00 2001 From: ab Date: Tue, 21 May 2019 17:11:17 -0400 Subject: search bar ui fixes --- src/client/views/MainView.tsx | 20 +++++++++++++++++++- src/client/views/SearchBox.tsx | 4 ++-- 2 files changed, 21 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx index 6169466bc..aa34a12ed 100644 --- a/src/client/views/MainView.tsx +++ b/src/client/views/MainView.tsx @@ -40,6 +40,7 @@ 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)); @@ -56,6 +57,7 @@ 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")) { @@ -260,17 +262,33 @@ export class MainView extends React.Component { return [ ,
+
, -
, +
,
]; } + @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"; + } + } + + } + render() { return (
diff --git a/src/client/views/SearchBox.tsx b/src/client/views/SearchBox.tsx index 0ec1a6758..911fc8d9c 100644 --- a/src/client/views/SearchBox.tsx +++ b/src/client/views/SearchBox.tsx @@ -171,8 +171,8 @@ export class SearchBox extends React.Component { - - + {/* */} + {/* */}
{this._resultsOpen ? (
-- cgit v1.2.3-70-g09d2