aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/views/nodes/FormattedTextBox.tsx2
-rw-r--r--src/client/views/nodes/LinkMenuItem.tsx16
2 files changed, 6 insertions, 12 deletions
diff --git a/src/client/views/nodes/FormattedTextBox.tsx b/src/client/views/nodes/FormattedTextBox.tsx
index 8d9944d59..f2c27d303 100644
--- a/src/client/views/nodes/FormattedTextBox.tsx
+++ b/src/client/views/nodes/FormattedTextBox.tsx
@@ -739,7 +739,7 @@ export class FormattedTextBox extends DocComponent<(FieldViewProps & FormattedTe
if (DocumentManager.Instance.getDocumentView(jumpToDoc)) {
// if !guid, then generate guid and apply to full doc
if (!guid) {
- console.log('making new guid!');
+ console.log('making new guid!'); // hehheehhehehe
linkDoc.guid = Utils.GenerateGuid();
}
DocumentManager.Instance.jumpToDocument(jumpToDoc, e.altKey, undefined, undefined, NumCast((jumpToDoc === linkDoc.anchor2 ? linkDoc.anchor2Page : linkDoc.anchor1Page)));
diff --git a/src/client/views/nodes/LinkMenuItem.tsx b/src/client/views/nodes/LinkMenuItem.tsx
index ffc191235..259dbc04e 100644
--- a/src/client/views/nodes/LinkMenuItem.tsx
+++ b/src/client/views/nodes/LinkMenuItem.tsx
@@ -46,14 +46,6 @@ export class LinkMenuItem extends React.Component<LinkMenuItemProps> {
let targetContext = await Cast(proto.targetContext, Doc);
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(); };
@@ -67,10 +59,12 @@ export class LinkMenuItem extends React.Component<LinkMenuItemProps> {
else if (this.props.destinationDoc === self.props.linkDoc.anchor1 && sourceContext) {
DocumentManager.Instance.jumpToDocument(jumpToDoc, e.altKey, false, document => dockingFunc(sourceContext!));
if (guid) {
+ console.log('wegotthis', self.props.linkDoc.anchor2, jumpToDoc[Id]);
+ jumpToDoc.linkHref = Utils.prepend("/doc/" + StrCast(this.props.linkDoc.anchor2));
jumpToDoc.guid = guid;
- } else if (href) { // retroactively fixing old in-text links by adding guid
- console.log('wegotthis', href, href2, proto.href, guid);
- jumpToDoc.linkHref = href;
+ } else { // retroactively fixing old in-text links by adding guid
+ console.log('wegotthis', self.props.linkDoc.anchor2, jumpToDoc[Id]);
+ jumpToDoc.linkHref = Utils.prepend("/doc/" + StrCast(this.props.linkDoc.anchor2));
let newguid = Utils.GenerateGuid();
this.props.linkDoc.guid = newguid;
jumpToDoc.guid = newguid;