aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-11-16 16:26:31 -0500
committerbobzel <zzzman@gmail.com>2022-11-16 16:26:31 -0500
commitae324ff50865929be836edf3bbf129207638a9c9 (patch)
tree6a337590344071657348264404a51e3650e693fb /src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
parent2827ad04901e076ffa399f8b069eb64e8be64b6f (diff)
big changes to make link following use the same code as pinning docs for trails.
Diffstat (limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx')
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index 932bd789d..8a97797c7 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -1530,11 +1530,27 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
return 0;
};
+ @action
+ scrollFocus = (anchor: Doc, smooth: boolean) => {
+ let focusSpeed: Opt<number>;
+ PresBox.restoreTargetDocView(
+ this.rootDoc, //
+ { pinDocLayout: BoolCast(anchor.presPinDocLayout) },
+ anchor,
+ (focusSpeed = !smooth ? 0 : NumCast(anchor.presTransition)),
+ {
+ pannable: anchor.presPinData ? true : false,
+ }
+ );
+ return focusSpeed;
+ }; // sets viewing information for a componentview, typically when following a link. 'preview' tells the view to use the values without writing to the document
+
getAnchor = () => {
if (this.props.Document.annotationOn) {
return this.rootDoc;
}
- const anchor = Docs.Create.TextanchorDocument({ title: 'ViewSpec - ' + StrCast(this.layoutDoc._viewType), annotationOn: this.rootDoc });
+ const anchor = Docs.Create.TextanchorDocument({ title: 'ViewSpec - ' + StrCast(this.layoutDoc._viewType), presTransition: 500, annotationOn: this.rootDoc });
+ PresBox.pinDocView(anchor, { pinData: { pannable: true } }, this.rootDoc);
const proto = Doc.GetProto(anchor);
proto[ViewSpecPrefix + '_viewType'] = this.layoutDoc._viewType;
proto.docFilters = ObjectField.MakeCopy(this.layoutDoc.docFilters as ObjectField) || new List<string>([]);