aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionTimeView.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/collections/CollectionTimeView.tsx')
-rw-r--r--src/client/views/collections/CollectionTimeView.tsx39
1 files changed, 9 insertions, 30 deletions
diff --git a/src/client/views/collections/CollectionTimeView.tsx b/src/client/views/collections/CollectionTimeView.tsx
index e6f29ec37..4d5978548 100644
--- a/src/client/views/collections/CollectionTimeView.tsx
+++ b/src/client/views/collections/CollectionTimeView.tsx
@@ -21,7 +21,7 @@ import { CollectionFreeFormView } from './collectionFreeForm/CollectionFreeFormV
import { CollectionSubView } from './CollectionSubView';
import './CollectionTimeView.scss';
import React = require('react');
-import { DocFocusOptions } from '../nodes/DocumentView';
+import { DocFocusOptions, DocumentView } from '../nodes/DocumentView';
import { PresBox } from '../nodes/trails';
@observer
@@ -52,8 +52,7 @@ export class CollectionTimeView extends CollectionSubView() {
title: ComputedField.MakeFunction(`"${this.pivotField}"])`) as any,
annotationOn: this.rootDoc,
});
- anchor.presPinPivotField = this.pivotField; // should be captured in pinDocView below
- PresBox.pinDocView(anchor, { pinData: { viewType: true, filters: true } }, this.rootDoc);
+ PresBox.pinDocView(anchor, { pinData: { viewType: true, pivot: true, filters: true } }, this.rootDoc);
if (addAsAnnotation) {
// when added as an annotation, links to anchors can be found as links to the document even if the anchors are not rendered
@@ -67,32 +66,12 @@ export class CollectionTimeView extends CollectionSubView() {
};
@action
- scrollFocus = (anchor: Doc, options: DocFocusOptions) => {
- if (options.preview) {
- // if in preview, then override document's fields with view spec
- this._focusFilters = StrListCast(anchor.presPinDocFilters);
- this._focusRangeFilters = StrListCast(anchor.presPinDocRangeFilters);
- this._focusPivotField = StrCast(anchor.presPinPivotField);
- return undefined;
- }
- const focusSpeed = options.instant ? 0 : options.zoomTime ?? 500;
-
- // should be part of restoreTargetDocView
- this.layoutDoc._prevFilterIndex = 1;
- this.layoutDoc._pivotField = anchor.presPinPivotField;
-
- return PresBox.restoreTargetDocView(
- this.props.DocumentView?.(), //
- { pinDocLayout: BoolCast(anchor.presPinLayout) },
- anchor,
- focusSpeed,
- {
- viewType: anchor.presPinViewType ? true : false,
- filters: anchor.presPinDocFilters || anchor.presPinDocRangeFilters ? true : false,
- }
- )
- ? focusSpeed
- : undefined;
+ scrollPreview = (docView: DocumentView, anchor: Doc, focusSpeed: number, options: DocFocusOptions) => {
+ // if in preview, then override document's fields with view spec
+ this._focusFilters = StrListCast(anchor.presDocFilters);
+ this._focusRangeFilters = StrListCast(anchor.presPinDocRangeFilters);
+ this._focusPivotField = StrCast(anchor.presPivotField);
+ return undefined;
};
layoutEngine = () => this._layoutEngine;
@@ -171,7 +150,7 @@ export class CollectionTimeView extends CollectionSubView() {
engineProps={{ pivotField: this.pivotField, docFilters: this.childDocFilters, docRangeFilters: this.childDocRangeFilters }}
fitContentsToBox={returnTrue}
childClickScript={this._childClickedScript}
- viewDefDivClick={this._viewDefDivClick}
+ viewDefDivClick={this.layoutEngine() === computeTimelineLayout.name ? undefined : this._viewDefDivClick}
//dontScaleFilter={this.dontScaleFilter}
layoutEngine={this.layoutEngine}
/>