aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/LinkDocPreview.tsx
diff options
context:
space:
mode:
authorusodhi <61431818+usodhi@users.noreply.github.com>2020-12-10 22:28:43 +0530
committerusodhi <61431818+usodhi@users.noreply.github.com>2020-12-10 22:28:43 +0530
commit563d86f03f63f60ec47aef23d2022c660ee18697 (patch)
treeefd71242ac43dba47e7d44da3d4874dcc8f71d3e /src/client/views/nodes/LinkDocPreview.tsx
parent49491180cfbc03b72867970043b674dc1362cc81 (diff)
parent3412313dcde569f1f23616fa5e8a92c3985e0449 (diff)
merging
Diffstat (limited to 'src/client/views/nodes/LinkDocPreview.tsx')
-rw-r--r--src/client/views/nodes/LinkDocPreview.tsx11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/client/views/nodes/LinkDocPreview.tsx b/src/client/views/nodes/LinkDocPreview.tsx
index 0256d394e..f66811098 100644
--- a/src/client/views/nodes/LinkDocPreview.tsx
+++ b/src/client/views/nodes/LinkDocPreview.tsx
@@ -12,12 +12,13 @@ import { ContentFittingDocumentView } from "./ContentFittingDocumentView";
import { DocumentLinksButton } from './DocumentLinksButton';
import React = require("react");
import { DocumentViewProps } from './DocumentView';
+import { Id } from '../../../fields/FieldSymbols';
interface Props {
linkDoc?: Doc;
linkSrc?: Doc;
href?: string;
- styleProvider?: (doc: Opt<Doc>, props: Opt<DocumentViewProps>, property: string, layerProvider?: (doc: Doc, assign?: boolean) => boolean) => any;
+ styleProvider?: (doc: Opt<Doc>, props: Opt<DocumentViewProps>, property: string) => any;
addDocTab: (document: Doc, where: string) => boolean;
location: number[];
}
@@ -64,8 +65,11 @@ export class LinkDocPreview extends React.Component<Props> {
runInAction(() => {
this._toolTipText = "";
LinkDocPreview.TargetDoc = this._targetDoc = target;
- if (anchor !== this._targetDoc && anchor && this._targetDoc) {
- this._targetDoc._scrollPreviewY = NumCast(anchor?.y);
+ if (this._targetDoc) {
+ this._targetDoc._scrollToPreviewLinkID = linkDoc?.[Id];
+ if (anchor !== this._targetDoc && anchor) {
+ this._targetDoc._scrollPreviewY = NumCast(anchor?.y);
+ }
}
});
}
@@ -90,7 +94,6 @@ export class LinkDocPreview extends React.Component<Props> {
:
<ContentFittingDocumentView
Document={this._targetDoc}
- LibraryPath={emptyPath}
fitToBox={true}
moveDocument={returnFalse}
rootSelected={returnFalse}