diff options
| author | bobzel <zzzman@gmail.com> | 2020-08-22 09:49:56 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2020-08-22 09:49:56 -0400 |
| commit | 4ed30f48bd0c87f0a5ccb484d78bf4601ab6ff74 (patch) | |
| tree | 15930585ee9bdf3b6278206cd1a3f972fa01c5f3 /src/client/views/collections/CollectionSchemaCells.tsx | |
| parent | cbedd8e1e651843e50f8f27163bf8e2a1a574009 (diff) | |
switched search from writiing searchMatch to matched docs to instead store in a run-time observableMap. This allows simultaneous searches by different users.
Diffstat (limited to 'src/client/views/collections/CollectionSchemaCells.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionSchemaCells.tsx | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/src/client/views/collections/CollectionSchemaCells.tsx b/src/client/views/collections/CollectionSchemaCells.tsx index ea786800c..4bd69041b 100644 --- a/src/client/views/collections/CollectionSchemaCells.tsx +++ b/src/client/views/collections/CollectionSchemaCells.tsx @@ -894,26 +894,22 @@ export class CollectionSchemaCheckboxCell extends CollectionSchemaCell { export class CollectionSchemaButtons extends CollectionSchemaCell { render() { const doc = this.props.rowProps.original; - const searchMatch = (backward: boolean = true) => { doc.searchMatch = undefined; setTimeout(() => doc.searchMatch = backward, 0); }; + const searchMatch = (backward: boolean = true) => Doc.SearchMatchNext(doc, backward); // const reference = React.createRef<HTMLDivElement>(); // const onItemDown = (e: React.PointerEvent) => { // (!this.props.CollectionView || !this.props.CollectionView.props.isSelected() ? undefined : // SetupDrag(reference, () => this._document, this.props.moveDocument, this.props.Document.schemaDoc ? "copy" : undefined)(e)); // }; return !BoolCast(this.props.Document._searchDoc) ? <></> - : StrCast(doc.type) === DocumentType.PDF ? - <button style={{ position: "relative", height: 30, width: 28, left: 1, }} onClick={() => searchMatch(false)}> - <FontAwesomeIcon icon="arrow-down" size="sm" /> - </button> - : StrCast(doc.type) === DocumentType.RTF ? - <div style={{ paddingTop: 8, paddingLeft: 3, }} > - <button style={{ padding: 2, left: 77 }} onClick={() => searchMatch(true)}> - <FontAwesomeIcon icon="arrow-up" size="sm" /> - </button> - <button style={{ padding: 2 }} onClick={() => searchMatch(false)} > - <FontAwesomeIcon icon="arrow-down" size="sm" /> - </button> - </div> : - <></>; + : [DocumentType.PDF, DocumentType.RTF].includes(StrCast(doc.type) as DocumentType) ? + <div style={{ paddingTop: 8, paddingLeft: 3, }} > + <button style={{ padding: 2, left: 77 }} onClick={() => searchMatch(true)}> + <FontAwesomeIcon icon="arrow-up" size="sm" /> + </button> + <button style={{ padding: 2 }} onClick={() => searchMatch(false)} > + <FontAwesomeIcon icon="arrow-down" size="sm" /> + </button> + </div> : + <></>; } }
\ No newline at end of file |
