aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionView.tsx
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2020-07-01 01:53:42 -0400
committerBob Zeleznik <zzzman@gmail.com>2020-07-01 01:53:42 -0400
commit973e49dc36f208cc7f9a261cbe03e8d65d001b92 (patch)
tree6ba34a3458a62f7af274303edb42dcd8a62c7304 /src/client/views/collections/CollectionView.tsx
parent6af97864aabe89153487d37bf78391ff525deadd (diff)
added isPushpin. added 'hidden' for DocumentViews to stop displaying them. made pushpin's FontIconBox's. made Esc close context menu.
Diffstat (limited to 'src/client/views/collections/CollectionView.tsx')
-rw-r--r--src/client/views/collections/CollectionView.tsx12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/client/views/collections/CollectionView.tsx b/src/client/views/collections/CollectionView.tsx
index dab82185a..705fbdd34 100644
--- a/src/client/views/collections/CollectionView.tsx
+++ b/src/client/views/collections/CollectionView.tsx
@@ -141,15 +141,17 @@ export class CollectionView extends Touchable<FieldViewProps & CollectionViewCus
} else {
added.map(doc => {
const context = Cast(doc.context, Doc, null);
- if (context && (context?.type === DocumentType.VID || context.type === DocumentType.WEB || context.type === DocumentType.PDF || context.type === DocumentType.IMG)) {
- const pushpin = Docs.Create.FreeformDocument([], {
- title: "pushpin", x: Cast(doc.x, "number", null), y: Cast(doc.y, "number", null),
- _width: 10, _height: 10, _backgroundColor: "red", isLinkButton: true, displayTimecode: Cast(doc.displayTimecode, "number", null)
+ if (context && (context.type === DocumentType.VID || context.type === DocumentType.WEB || context.type === DocumentType.PDF || context.type === DocumentType.IMG) &&
+ !DocListCast(doc.links).some(d => d.isPushpin)) {
+ const pushpin = Docs.Create.FontIconDocument({
+ icon: "map-pin", x: Cast(doc.x, "number", null), y: Cast(doc.y, "number", null), _backgroundColor: "#0000003d", color: "#ACCEF7",
+ _width: 15, _height: 15, _xPadding: 0, isLinkButton: true, displayTimecode: Cast(doc.displayTimecode, "number", null)
});
Doc.AddDocToList(context, Doc.LayoutFieldKey(context) + "-annotations", pushpin);
- DocUtils.MakeLink({ doc: pushpin }, { doc: doc }, "pushpin");
+ const pushpinLink = DocUtils.MakeLink({ doc: pushpin }, { doc: doc }, "pushpin");
const first = DocListCast(pushpin.links).find(d => d instanceof Doc);
first && (first.hidden = true);
+ pushpinLink && (Doc.GetProto(pushpinLink).isPushpin = true);
doc.displayTimecode = undefined;
}
doc.context = this.props.Document;