From 86a8751ca5a66fd42d7b2b3dee56210f2ef2b62d Mon Sep 17 00:00:00 2001 From: Melissa Zhang Date: Thu, 23 Jul 2020 13:20:12 -0700 Subject: adjustments to link following/editing behavior --- src/client/views/nodes/DocumentLinksButton.tsx | 30 ++++++++++++++++---------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'src/client/views/nodes') diff --git a/src/client/views/nodes/DocumentLinksButton.tsx b/src/client/views/nodes/DocumentLinksButton.tsx index d753edbeb..4c60d03fd 100644 --- a/src/client/views/nodes/DocumentLinksButton.tsx +++ b/src/client/views/nodes/DocumentLinksButton.tsx @@ -60,10 +60,18 @@ export class DocumentLinksButton extends React.Component { // event used by hypothes.is plugin to tell Dash which annotation to link from + linkAnnotation = async (e: any) => { // event sent by hypothes.is plugin to tell Dash which annotation we're linking from const annotationId = e.detail.id; - const sourceUrl = e.detail.uri; - console.log(annotationId, sourceUrl); + const annotationUri = e.detail.uri; + console.log(annotationId, annotationUri); + // const source = await Hypothesis.getWebDoc(annotationUri); + + const source = SelectionManager.SelectedDocuments()[0]; // TO BE FIXED, currently link just starts from whichever doc is selected + runInAction(() => { + DocumentLinksButton.AnnotationId = annotationId; + DocumentLinksButton.AnnotationUri = annotationUri; + DocumentLinksButton.StartLink = source; + }); } @action @@ -133,14 +141,14 @@ export class DocumentLinksButton extends React.Component { -- cgit v1.2.3-70-g09d2