aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents/Documents.ts
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2020-07-29 01:05:43 -0400
committerBob Zeleznik <zzzman@gmail.com>2020-07-29 01:05:43 -0400
commit28ab7ecd633e92619adfcbd1ce3ca72ddbba7ea8 (patch)
treee416e59d93150b09ef0c6fd69c717f39279b0d4c /src/client/documents/Documents.ts
parent502981833ef7f9e8179bf9c487b1e35404c6d4e1 (diff)
fixed up dot anchors on audio labels/anchors
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r--src/client/documents/Documents.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index fb9f6fe46..122383744 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -192,6 +192,7 @@ export interface DocumentOptions {
filterQuery?: string;
linearViewIsExpanded?: boolean; // is linear view expanded
isLabel?: boolean; // whether the document is a label or not (video / audio)
+ useLinkSmallAnchor?: boolean; // whether links to this document should use a miniature linkAnchorBox
audioStart?: number; // the time frame where the audio should begin playing
audioEnd?: number; // the time frame where the audio should stop playing
}
@@ -627,7 +628,7 @@ export namespace Docs {
}
export function AudioDocument(url: string, options: DocumentOptions = {}) {
- const instance = InstanceFromProto(Prototypes.get(DocumentType.AUDIO), new AudioField(new URL(url)), options);
+ const instance = InstanceFromProto(Prototypes.get(DocumentType.AUDIO), new AudioField(new URL(url)), { hideLinkButton: true, useLinkSmallAnchor: true, ...options });
Doc.GetProto(instance).backgroundColor = ComputedField.MakeFunction("this._audioState === 'playing' ? 'green':'gray'");
return instance;
}
@@ -925,6 +926,8 @@ export namespace DocUtils {
if (target.doc === Doc.UserDoc()) return undefined;
const linkDoc = Docs.Create.LinkDocument(source, target, { linkRelationship, layoutKey: "layout_linkView", description }, id);
+ Doc.GetProto(linkDoc)["anchor1-useLinkSmallAnchor"] = source.doc.useLinkSmallAnchor;
+ Doc.GetProto(linkDoc)["anchor2-useLinkSmallAnchor"] = target.doc.useLinkSmallAnchor;
linkDoc.linkDisplay = true;
linkDoc.hidden = true;
linkDoc.layout_linkView = Cast(Cast(Doc.UserDoc()["template-button-link"], Doc, null).dragFactory, Doc, null);