diff options
author | kimdahey <claire_kim1@brown.edu> | 2019-08-28 16:19:54 -0400 |
---|---|---|
committer | kimdahey <claire_kim1@brown.edu> | 2019-08-28 16:19:54 -0400 |
commit | e0b8d5f213d7f547b939877c71f07804ac8c24cf (patch) | |
tree | 092ec6f5692722fcb16898f4a6065aac47d52333 | |
parent | 2f81ba96ac9c2aecbb9d610ecdc7d35335931e38 (diff) |
working
-rw-r--r-- | src/client/views/nodes/FormattedTextBox.tsx | 1 | ||||
-rw-r--r-- | src/client/views/nodes/LinkMenuItem.tsx | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/client/views/nodes/FormattedTextBox.tsx b/src/client/views/nodes/FormattedTextBox.tsx index 33edcc7f6..8d9944d59 100644 --- a/src/client/views/nodes/FormattedTextBox.tsx +++ b/src/client/views/nodes/FormattedTextBox.tsx @@ -187,6 +187,7 @@ export class FormattedTextBox extends DocComponent<(FieldViewProps & FormattedTe marks[linkIndex].attrs.guid = guid; return node; } + console.log('href was and is ', href, marks[linkIndex].attrs.href); } return undefined; } diff --git a/src/client/views/nodes/LinkMenuItem.tsx b/src/client/views/nodes/LinkMenuItem.tsx index a012c9db2..ffc191235 100644 --- a/src/client/views/nodes/LinkMenuItem.tsx +++ b/src/client/views/nodes/LinkMenuItem.tsx @@ -47,9 +47,13 @@ export class LinkMenuItem extends React.Component<LinkMenuItemProps> { let sourceContext = await Cast(proto.sourceContext, Doc); let guid = StrCast(this.props.linkDoc.guid); let href; + let href2; if (sourceContext) { href = Utils.prepend("/doc/" + sourceContext[Id]); // trying to get id (?) so that we can search for this in the link marks } + if (targetContext) { + href2 = Utils.prepend("/doc/" + targetContext[Id]); // trying to get id (?) so that we can search for this in the link marks + } let self = this; let dockingFunc = (document: Doc) => { this.props.addDocTab(document, undefined, "inTab"); SelectionManager.DeselectAll(); }; @@ -65,9 +69,10 @@ export class LinkMenuItem extends React.Component<LinkMenuItemProps> { if (guid) { jumpToDoc.guid = guid; } else if (href) { // retroactively fixing old in-text links by adding guid - console.log('wegotthis', href, guid); + console.log('wegotthis', href, href2, proto.href, guid); jumpToDoc.linkHref = href; let newguid = Utils.GenerateGuid(); + this.props.linkDoc.guid = newguid; jumpToDoc.guid = newguid; } } |