aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/search
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-08-07 23:27:21 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-08-07 23:27:21 -0400
commitebddce0975fa7e224e022cc075eee71abeacbe1d (patch)
treea629963e9c12870aac72514ccf3aea55e1a94b22 /src/client/views/search
parent941c50617a0cbaef054f2be856de013bd69ea81f (diff)
changed pdfs to render regions as collections. changed libraryBrush implementation.
Diffstat (limited to 'src/client/views/search')
-rw-r--r--src/client/views/search/SearchItem.tsx38
1 files changed, 11 insertions, 27 deletions
diff --git a/src/client/views/search/SearchItem.tsx b/src/client/views/search/SearchItem.tsx
index c4af30f5c..8201aa374 100644
--- a/src/client/views/search/SearchItem.tsx
+++ b/src/client/views/search/SearchItem.tsx
@@ -105,23 +105,11 @@ export interface LinkMenuProps {
@observer
export class LinkContextMenu extends React.Component<LinkMenuProps> {
- highlightDoc = (doc: Doc) => {
- return () => {
- doc.libraryBrush = true;
- };
- }
+ highlightDoc = (doc: Doc) => () => Doc.BrushDoc(doc);
- unHighlightDoc = (doc: Doc) => {
- return () => {
- doc.libraryBrush = false;
- };
- }
+ unHighlightDoc = (doc: Doc) => () => Doc.UnBrushDoc(doc);
- getOnClick(col: Doc) {
- return () => {
- CollectionDockingView.Instance.AddRightSplit(col, undefined);
- };
- }
+ getOnClick = (col: Doc) => () => CollectionDockingView.Instance.AddRightSplit(col, undefined);
render() {
return (
@@ -286,14 +274,12 @@ export class SearchItem extends React.Component<SearchItemProps> {
let doc1 = Cast(this.props.doc.anchor1, Doc, null);
let doc2 = Cast(this.props.doc.anchor2, Doc, null);
- doc1 && (doc1.libraryBrush = true);
- doc2 && (doc2.libraryBrush = true);
+ Doc.BrushDoc(doc1);
+ Doc.BrushDoc(doc2);
}
} else {
- let docViews: DocumentView[] = DocumentManager.Instance.getAllDocumentViews(this.props.doc);
- docViews.forEach(element => {
- element.props.Document.libraryBrush = true;
- });
+ DocumentManager.Instance.getAllDocumentViews(this.props.doc).forEach(element =>
+ Doc.BrushDoc(element.props.Document));
}
}
@@ -303,14 +289,12 @@ export class SearchItem extends React.Component<SearchItemProps> {
let doc1 = Cast(this.props.doc.anchor1, Doc, null);
let doc2 = Cast(this.props.doc.anchor2, Doc, null);
- doc1 && (doc1.libraryBrush = false);
- doc2 && (doc2.libraryBrush = false);
+ Doc.UnBrushDoc(doc1);
+ Doc.UnBrushDoc(doc2);
}
} else {
- let docViews: DocumentView[] = DocumentManager.Instance.getAllDocumentViews(this.props.doc);
- docViews.forEach(element => {
- element.props.Document.libraryBrush = false;
- });
+ DocumentManager.Instance.getAllDocumentViews(this.props.doc).
+ forEach(element => Doc.UnBrushDoc(element.props.Document));
}
}