diff options
| author | bob <bcz@cs.brown.edu> | 2019-09-23 13:27:38 -0400 |
|---|---|---|
| committer | bob <bcz@cs.brown.edu> | 2019-09-23 13:27:38 -0400 |
| commit | 9fbdb0088bb42235bb530602c5275e015f2609bd (patch) | |
| tree | 99de655f052bb939cc4233f8bdace29e2e228fed /src/client/views/linking/LinkFollowBox.tsx | |
| parent | 81551fad8582129bc05581cdd132cada5e9f23db (diff) | |
restructured link following to text regions
Diffstat (limited to 'src/client/views/linking/LinkFollowBox.tsx')
| -rw-r--r-- | src/client/views/linking/LinkFollowBox.tsx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/client/views/linking/LinkFollowBox.tsx b/src/client/views/linking/LinkFollowBox.tsx index 1280ae28b..cad404d1f 100644 --- a/src/client/views/linking/LinkFollowBox.tsx +++ b/src/client/views/linking/LinkFollowBox.tsx @@ -243,7 +243,7 @@ export class LinkFollowBox extends React.Component<FieldViewProps> { let proto = Doc.GetProto(LinkFollowBox.linkDoc); let targetContext = await Cast(proto.targetContext, Doc); let sourceContext = await Cast(proto.sourceContext, Doc); - let guid = StrCast(LinkFollowBox.linkDoc.guid); + let guid = StrCast(LinkFollowBox.linkDoc[Id]); const shouldZoom = options ? options.shouldZoom : false; let dockingFunc = (document: Doc) => { (this._addDocTab || this.props.addDocTab)(document, undefined, "inTab"); SelectionManager.DeselectAll(); }; @@ -255,12 +255,10 @@ export class LinkFollowBox extends React.Component<FieldViewProps> { DocumentManager.Instance.jumpToDocument(jumpToDoc, shouldZoom, false, document => dockingFunc(sourceContext!)); if (LinkFollowBox.sourceDoc && LinkFollowBox.destinationDoc) { if (guid) { - LinkFollowBox.destinationDoc.guid = guid; + let views = DocumentManager.Instance.getDocumentViews(jumpToDoc); + views.length && (views[0].props.Document.scrollToLinkID = guid); } else { jumpToDoc.linkHref = Utils.prepend("/doc/" + StrCast(LinkFollowBox.linkDoc[Id])); - let newguid = Utils.GenerateGuid(); - LinkFollowBox.linkDoc.guid = newguid; - LinkFollowBox.destinationDoc.guid = newguid; } } } |
