aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/collections')
-rw-r--r--src/client/views/collections/CollectionNoteTakingView.tsx1
-rw-r--r--src/client/views/collections/CollectionStackedTimeline.tsx37
-rw-r--r--src/client/views/collections/CollectionStackingView.tsx1
-rw-r--r--src/client/views/collections/collectionSchema/CollectionSchemaView.tsx1
4 files changed, 13 insertions, 27 deletions
diff --git a/src/client/views/collections/CollectionNoteTakingView.tsx b/src/client/views/collections/CollectionNoteTakingView.tsx
index a69049b59..c7ad80f11 100644
--- a/src/client/views/collections/CollectionNoteTakingView.tsx
+++ b/src/client/views/collections/CollectionNoteTakingView.tsx
@@ -269,7 +269,6 @@ export class CollectionNoteTakingView extends CollectionSubView() {
whenChildContentsActiveChanged={this.props.whenChildContentsActiveChanged}
addDocTab={this.props.addDocTab}
bringToFront={returnFalse}
- scriptContext={this.props.scriptContext}
pinToPres={this.props.pinToPres}
/>
);
diff --git a/src/client/views/collections/CollectionStackedTimeline.tsx b/src/client/views/collections/CollectionStackedTimeline.tsx
index ad3160a08..c4650647c 100644
--- a/src/client/views/collections/CollectionStackedTimeline.tsx
+++ b/src/client/views/collections/CollectionStackedTimeline.tsx
@@ -58,9 +58,7 @@ export class CollectionStackedTimeline extends CollectionSubView<CollectionStack
@observable static SelectingRegion: CollectionStackedTimeline | undefined = undefined;
@observable public static CurrentlyPlaying: DocumentView[];
- static RangeScript: ScriptField;
static LabelScript: ScriptField;
- static RangePlayScript: ScriptField;
static LabelPlayScript: ScriptField;
private _timeline: HTMLDivElement | null = null; // ref to actual timeline div
@@ -114,25 +112,6 @@ export class CollectionStackedTimeline extends CollectionSubView<CollectionStack
return this._zoomFactor;
}
- constructor(props: any) {
- super(props);
- // onClick play scripts
- CollectionStackedTimeline.RangeScript =
- CollectionStackedTimeline.RangeScript ||
- ScriptField.MakeFunction(`scriptContext.clickAnchor(this, clientX)`, {
- self: Doc.name,
- scriptContext: 'any',
- clientX: 'number',
- })!;
- CollectionStackedTimeline.RangePlayScript =
- CollectionStackedTimeline.RangePlayScript ||
- ScriptField.MakeFunction(`scriptContext.playOnClick(this, clientX)`, {
- self: Doc.name,
- scriptContext: 'any',
- clientX: 'number',
- })!;
- }
-
componentDidMount() {
document.addEventListener('keydown', this.keyEvents, true);
}
@@ -179,8 +158,19 @@ export class CollectionStackedTimeline extends CollectionSubView<CollectionStack
return Math.max(this.clipStart, Math.min(this.clipEnd, (screen_delta / width) * this.clipDuration + this.clipStart));
};
- rangeClickScript = () => CollectionStackedTimeline.RangeScript;
- rangePlayScript = () => CollectionStackedTimeline.RangePlayScript;
+ @computed get rangeClick() {
+ // prettier-ignore
+ return ScriptField.MakeFunction('stackedTimeline.clickAnchor(this, clientX)',
+ { stackedTimeline: 'any', clientX: 'number' }, { stackedTimeline: this as any }
+ )!;
+ }
+ @computed get rangePlay() {
+ // prettier-ignore
+ return ScriptField.MakeFunction('stackedTimeline.playOnClick(this, clientX)',
+ { stackedTimeline: 'any', clientX: 'number' }, { stackedTimeline: this as any })!;
+ }
+ rangeClickScript = () => this.rangeClick;
+ rangePlayScript = () => this.rangePlay;
// handles key events for for creating key anchors, scrubbing, exiting trim
@action
@@ -835,7 +825,6 @@ class StackedTimelineAnchor extends React.Component<StackedTimelineAnchorProps>
hideResizeHandles={true}
bringToFront={emptyFunction}
contextMenuItems={this.contextMenuItems}
- scriptContext={this.props.stackedTimeline}
/>
),
};
diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx
index 36f8bc101..c43a9d2b8 100644
--- a/src/client/views/collections/CollectionStackingView.tsx
+++ b/src/client/views/collections/CollectionStackingView.tsx
@@ -361,7 +361,6 @@ export class CollectionStackingView extends CollectionSubView<Partial<collection
whenChildContentsActiveChanged={this.props.whenChildContentsActiveChanged}
addDocTab={this.props.addDocTab}
bringToFront={returnFalse}
- scriptContext={this.props.scriptContext}
pinToPres={this.props.pinToPres}
/>
);
diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
index d2b61167e..f73c037f4 100644
--- a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
+++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
@@ -972,7 +972,6 @@ class CollectionSchemaViewDocs extends React.Component<CollectionSchemaViewDocsP
hideDocumentButtonBar={true}
hideLinkAnchors={true}
layout_fitWidth={returnTrue}
- scriptContext={this}
/>
</div>
);