diff options
author | Melissa Zhang <mzhang19096@gmail.com> | 2020-07-03 17:08:10 -0700 |
---|---|---|
committer | Melissa Zhang <mzhang19096@gmail.com> | 2020-07-03 17:10:06 -0700 |
commit | 1934623881cf548e4dbe8e70eb2995ec2f6b8399 (patch) | |
tree | f6ba962c37d64b04ff3ea4b5f20d055cd0b7226c | |
parent | 28292ff91ea48b129dee6e692343790696e12b7f (diff) |
send both the doc's URL and title to hypothesis plugin
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 2c22bde81..a0a47ecfd 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -740,7 +740,11 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu cm.addItem({ description: "make hypothesis link", event: () => { const docUrl = Utils.prepend("/doc/" + this.props.Document[Id]); - document.dispatchEvent(new CustomEvent("hypothesisLink", { detail: docUrl })); + const docTitle = StrCast(this.layoutDoc.title); + document.dispatchEvent(new CustomEvent<{ url: string, title: string }>("hypothesisLink", { + detail: { url: docUrl, title: docTitle }, + bubbles: true + })); }, icon: "eye" }); |