aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-02-25 18:54:45 -0500
committerbobzel <zzzman@gmail.com>2021-02-25 18:54:45 -0500
commitfd329ad25987122c8f2a31177a6c346c97f00457 (patch)
tree86904c38d08388a5c4becf805f20f82b7a8b6c29 /src/client/views/collections/CollectionView.tsx
parent17ee7f6f1f61a079ec79b71aebc65abfd72ec32a (diff)
added 'proto' drag option for dropping proto of document. auto add of non annotations to file system. auto added delegates & aliases to a docuemnt's 'alias' field.
Diffstat (limited to 'src/client/views/collections/CollectionView.tsx')
-rw-r--r--src/client/views/collections/CollectionView.tsx5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/client/views/collections/CollectionView.tsx b/src/client/views/collections/CollectionView.tsx
index f305174f1..a217de193 100644
--- a/src/client/views/collections/CollectionView.tsx
+++ b/src/client/views/collections/CollectionView.tsx
@@ -153,12 +153,10 @@ export class CollectionView extends Touchable<CollectionViewProps> {
const hasContextAnchor = DocListCast(doc.links).some(l => (l.anchor2 === doc && Cast(l.anchor1, Doc, null)?.annotationOn === context) || (l.anchor1 === doc && Cast(l.anchor2, Doc, null)?.annotationOn === context));
if (context && !hasContextAnchor && (context.type === DocumentType.VID || context.type === DocumentType.WEB || context.type === DocumentType.PDF || context.type === DocumentType.IMG)) {
const pushpin = Docs.Create.FontIconDocument({
- title: "pushpin", label: "",
+ title: "pushpin", label: "", annotationOn: Cast(doc.annotationOn, Doc, null), isPushpin: true,
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, _timecodeToShow: Cast(doc._timecodeToShow, "number", null)
});
- pushpin.isPushpin = true;
- Doc.GetProto(pushpin).annotationOn = doc.annotationOn;
Doc.SetInPlace(doc, "annotationOn", undefined, true);
Doc.AddDocToList(context, Doc.LayoutFieldKey(context) + "-annotations", pushpin);
const pushpinLink = DocUtils.MakeLink({ doc: pushpin }, { doc: doc }, "pushpin", "");
@@ -191,6 +189,7 @@ export class CollectionView extends Touchable<CollectionViewProps> {
const ind = (targetDataDoc[this.props.fieldKey] as List<Doc>).indexOf(doc);
if (ind !== -1) {
Doc.RemoveDocFromList(targetDataDoc, this.props.fieldKey, doc);
+ doc.context = undefined;
recent && Doc.AddDocToList(recent, "data", doc, undefined, true, true);
}
});