diff options
Diffstat (limited to 'src/client/views')
| -rw-r--r-- | src/client/views/collections/CollectionSchemaCells.tsx | 19 | ||||
| -rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 13 |
2 files changed, 18 insertions, 14 deletions
diff --git a/src/client/views/collections/CollectionSchemaCells.tsx b/src/client/views/collections/CollectionSchemaCells.tsx index bf8c4b6f7..511fbc3a0 100644 --- a/src/client/views/collections/CollectionSchemaCells.tsx +++ b/src/client/views/collections/CollectionSchemaCells.tsx @@ -91,17 +91,14 @@ export class CollectionSchemaCell extends React.Component<CellProps> { this.props.changeFocusedCellByIndex(this.props.row, this.props.col); this.props.setPreviewDoc(this.props.rowProps.original); - const data = await DocListCastAsync(this.props.Document.data); - if (data) { - let url: string; - if (url = StrCast(data[0].href)) { - try { - new URL(url); - const temp = window.open(url)!; - temp.blur(); - window.focus(); - } catch { } - } + let url: string; + if (url = StrCast(this.props.rowProps.row.href)) { + try { + new URL(url); + const temp = window.open(url)!; + temp.blur(); + window.focus(); + } catch { } } // this._isEditing = true; diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index a034bc1f4..a80eafde2 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -777,9 +777,16 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu const extdoc = doc.data_ext as Doc; const values = await ClientRecommender.Instance.extractText(doc, extdoc ? extdoc : doc, false); const headers = [new SchemaHeaderField("title"), new SchemaHeaderField("href")]; - const body = Docs.Create.FreeformDocument([], { title: values.title }); - body.href = values.url; - CollectionDockingView.Instance.AddRightSplit(Docs.Create.SchemaDocument(headers, [body], { title: `Showing External Recommendations for "${StrCast(doc.title)}"` }), undefined); + let bodies: Doc[] = []; + const titles = values.title_vals; + const urls = values.url_vals; + for (let i = 0; i < 5; i++) { + const body = Docs.Create.FreeformDocument([], { title: titles[i] }); + body.href = urls[i]; + bodies.push(body); + } + + CollectionDockingView.Instance.AddRightSplit(Docs.Create.SchemaDocument(headers, bodies, { title: `Showing External Recommendations for "${StrCast(doc.title)}"` }), undefined); } onPointerEnter = (e: React.PointerEvent): void => { Doc.BrushDoc(this.props.Document); }; |
