From 840d7f00989a33dd0fd9a48a3c2076433340d3ac Mon Sep 17 00:00:00 2001 From: bobzel Date: Tue, 4 Aug 2020 12:56:15 -0400 Subject: cleanup of searchbox variables. --- src/client/views/search/SearchBox.tsx | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/client/views/search/SearchBox.tsx b/src/client/views/search/SearchBox.tsx index b7f7af244..c8a1c4e8e 100644 --- a/src/client/views/search/SearchBox.tsx +++ b/src/client/views/search/SearchBox.tsx @@ -206,13 +206,11 @@ export class SearchBox extends ViewBoxBaseComponent { this.expandedBucket = false }); // } - if (StrCast(this.layoutDoc._searchString) !== "") { - console.log("OPEN"); - runInAction(() => { this.open = true }); + if (StrCast(this.layoutDoc._searchString) !== "" || !this.searchFullDB) { + runInAction(() => this.open = true); } else { - console.log("CLOSE"); - runInAction(() => { this.open = false }); + runInAction(() => this.open = false); } this.submitSearch(); @@ -356,7 +354,6 @@ export class SearchBox extends ViewBoxBaseComponent { if (d.data != undefined) { - let newdocs = DocListCast(d.data); - newdocs.forEach((newdoc) => { - newarray.push(newdoc); - - }); + newarray.push(...DocListCast(d.data)); } - let hlights: string[] = []; const protos = Doc.GetAllPrototypes(d); - let proto = protos[protos.length - 1]; protos.forEach(proto => { Object.keys(proto).forEach(key => { // console.log(key, d[key]); @@ -403,7 +394,6 @@ export class SearchBox extends ViewBoxBaseComponent(docsforFilter); } this._numTotalResults = found.length; @@ -504,7 +494,7 @@ export class SearchBox extends ViewBoxBaseComponent { this._resultsOpen = true; this._searchbarOpen = true; @@ -515,7 +505,7 @@ export class SearchBox extends ViewBoxBaseComponent { e.stopPropagation(); SetupDrag(this.collectionRef, () => StrCast(this.layoutDoc._searchString) ? this.startDragCollection() : undefined); }} onClick={action(() => { - this.filter = !this.filter && !this.scale; + this.filter = !this.filter && !this.searchFullDB; if (this.filter === true && this.currentSelectedCollection !== undefined) { this.currentSelectedCollection.props.Document._searchDocs = new List(this.docsforfilter); this.currentSelectedCollection.props.Document._docFilters = new List(Cast(this.props.Document._docFilters, listSpec("string"), [])); @@ -1070,9 +1060,9 @@ export class SearchBox extends ViewBoxBaseComponent