aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/search/SearchBox.tsx
diff options
context:
space:
mode:
authortschicke-brown <tyler_schicke@brown.edu>2019-07-16 14:38:40 -0400
committerGitHub <noreply@github.com>2019-07-16 14:38:40 -0400
commit89645a61e95f8d9e760d6b18e2c006fcb003c900 (patch)
tree5bb7e5a0fa44183bd3824ce94971d2715631a445 /src/client/views/search/SearchBox.tsx
parent520fbe435330c8e426e2d504585ba1559300eadb (diff)
parent98c3a06256d2cbd720b2c193e5aa282c5dc25350 (diff)
Merge pull request #209 from browngraphicslab/search_virt
Search virt
Diffstat (limited to 'src/client/views/search/SearchBox.tsx')
-rw-r--r--src/client/views/search/SearchBox.tsx15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/client/views/search/SearchBox.tsx b/src/client/views/search/SearchBox.tsx
index dc76d1ff4..ba68ccd54 100644
--- a/src/client/views/search/SearchBox.tsx
+++ b/src/client/views/search/SearchBox.tsx
@@ -22,6 +22,7 @@ export class SearchBox extends React.Component {
@observable private _searchString: string = "";
@observable private _resultsOpen: boolean = false;
+ @observable private _searchbarOpen: boolean = false;
@observable private _results: Doc[] = [];
@observable private _openNoResults: boolean = false;
@observable private _visibleElements: JSX.Element[] = [];
@@ -107,6 +108,7 @@ export class SearchBox extends React.Component {
runInAction(() => {
this._resultsOpen = true;
+ this._searchbarOpen = true;
this._openNoResults = true;
this.resultsScrolled();
});
@@ -201,6 +203,7 @@ export class SearchBox extends React.Component {
this._openNoResults = false;
FilterBox.Instance.closeFilter();
this._resultsOpen = true;
+ this._searchbarOpen = true;
FilterBox.Instance._pointerTime = e.timeStamp;
}
@@ -208,6 +211,7 @@ export class SearchBox extends React.Component {
closeSearch = () => {
FilterBox.Instance.closeFilter();
this.closeResults();
+ this._searchbarOpen = false;
}
@action.bound
@@ -284,15 +288,10 @@ export class SearchBox extends React.Component {
}
@computed
- get resFull() {
- console.log(this._numTotalResults);
- return this._numTotalResults <= 8;
- }
+ get resFull() { return this._numTotalResults <= 8; }
@computed
- get resultHeight() {
- return this._numTotalResults * 70;
- }
+ get resultHeight() { return this._numTotalResults * 70; }
render() {
return (
@@ -303,7 +302,7 @@ export class SearchBox extends React.Component {
</span>
<input value={this._searchString} onChange={this.onChange} type="text" placeholder="Search..."
className="searchBox-barChild searchBox-input" onPointerDown={this.openSearch} onKeyPress={this.enter}
- style={{ width: this._resultsOpen ? "500px" : "100px" }} />
+ style={{ width: this._searchbarOpen ? "500px" : "100px" }} />
<button className="searchBox-barChild searchBox-submit" onClick={this.submitSearch} onPointerDown={FilterBox.Instance.stopProp}>Submit</button>
<button className="searchBox-barChild searchBox-filter" onClick={FilterBox.Instance.openFilter} onPointerDown={FilterBox.Instance.stopProp}>Filter</button>
</div>