aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/search
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-06-05 21:12:49 -0400
committerbobzel <zzzman@gmail.com>2022-06-05 21:12:49 -0400
commit716dd83325074aa2016e3993ff13c6f7001dc3df (patch)
tree2ba67e34a1ff6ce38f9199914ee4a8da769afa1e /src/client/views/search
parentb51b78c641c3e64f04cf878f02b5d7b1a620769e (diff)
parent0371242941dfdd1d689d0097140b203bb0b24dea (diff)
merged with master and added transcription icon view for recognized ink
Diffstat (limited to 'src/client/views/search')
-rw-r--r--src/client/views/search/SearchBox.tsx11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/client/views/search/SearchBox.tsx b/src/client/views/search/SearchBox.tsx
index eaa537596..574193614 100644
--- a/src/client/views/search/SearchBox.tsx
+++ b/src/client/views/search/SearchBox.tsx
@@ -113,7 +113,7 @@ export class SearchBox extends ViewBoxBaseComponent<SearchBoxProps>() {
if (this.props.linkFrom) {
const linkFrom = this.props.linkFrom();
if (linkFrom) {
- DocUtils.MakeLink({ doc: linkFrom }, { doc: linkTo }, "Link");
+ DocUtils.MakeLink({ doc: linkFrom }, { doc: linkTo });
}
}
});
@@ -128,9 +128,11 @@ export class SearchBox extends ViewBoxBaseComponent<SearchBoxProps>() {
static foreachRecursiveDoc(docs: Doc[], func: (depth: number, doc: Doc) => void) {
let newarray: Doc[] = [];
var depth = 0;
+ const visited: Doc[] = [];
while (docs.length > 0) {
newarray = [];
- docs.filter(d => d).forEach(d => {
+ docs.filter(d => d && !visited.includes(d)).forEach(d => {
+ visited.push(d);
const fieldKey = Doc.LayoutFieldKey(d);
const annos = !Field.toString(Doc.LayoutField(d) as Field).includes("CollectionView");
const data = d[annos ? fieldKey + "-annotations" : fieldKey];
@@ -340,6 +342,9 @@ export class SearchBox extends ViewBoxBaseComponent<SearchBoxProps>() {
const query = StrCast(this._searchString);
Doc.SetSearchQuery(query);
+ Array.from(this._results.keys()).forEach(doc =>
+ DocumentManager.Instance.getFirstDocumentView(doc)?.ComponentView?.search?.(this._searchString, undefined, true)
+ );
this._results.clear();
if (query) {
@@ -366,7 +371,7 @@ export class SearchBox extends ViewBoxBaseComponent<SearchBoxProps>() {
* or opening it in a new tab.
*/
selectElement = async (doc: Doc, finishFunc: () => void) => {
- await DocumentManager.Instance.jumpToDocument(doc, true, undefined, undefined, undefined, undefined, undefined, finishFunc);
+ await DocumentManager.Instance.jumpToDocument(doc, true, undefined, [], undefined, undefined, undefined, finishFunc);
}
/**