diff options
author | Melissa Zhang <mzhang19096@gmail.com> | 2020-07-06 16:01:42 -0700 |
---|---|---|
committer | Melissa Zhang <mzhang19096@gmail.com> | 2020-07-06 16:01:42 -0700 |
commit | 2e1284512f6f302673874ef3c368bdc50735f2a6 (patch) | |
tree | c6c875587ccc822fa111c29bce23ffb833613cda /src/client/views/nodes/DocumentView.tsx | |
parent | 15adf17efa078464643f8bcfd0f8c0b8afea8424 (diff) |
set up linking from Dash documents to annotation
Diffstat (limited to 'src/client/views/nodes/DocumentView.tsx')
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index a0c90e2b2..f42b72dbd 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -773,6 +773,15 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu }, icon: "eye" }); + cm.addItem({ + description: "pretend we made an annotation", event: () => { + document.dispatchEvent(new CustomEvent("fakeLinkStarted", { + detail: "hello this is fake", + bubbles: true + })); + }, icon: "eye" + }); + const customScripts = Cast(this.props.Document.contextMenuScripts, listSpec(ScriptField), []); Cast(this.props.Document.contextMenuLabels, listSpec("string"), []).forEach((label, i) => cm.addItem({ description: label, event: () => customScripts[i]?.script.run({ this: this.layoutDoc, self: this.rootDoc }), icon: "sticky-note" })); |