aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionMenu.tsx
diff options
context:
space:
mode:
authorMichael Foiani <sotech117@Michaels-MacBook-Pro-5.local>2022-08-18 18:27:16 +0200
committerMichael Foiani <sotech117@Michaels-MacBook-Pro-5.local>2022-08-18 18:27:16 +0200
commit4683ee7d40ab28d75002b674f52faf4e6c3cd965 (patch)
tree9091d7c15ee46750a43d188e27696e4266b90530 /src/client/views/collections/CollectionMenu.tsx
parent31995aa918e2683256c2f817d81c0fc892939486 (diff)
parent5a425e5cf18115921ecb4e7cf931e65f45dab8e2 (diff)
merge with newest master
Diffstat (limited to 'src/client/views/collections/CollectionMenu.tsx')
-rw-r--r--src/client/views/collections/CollectionMenu.tsx27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/client/views/collections/CollectionMenu.tsx b/src/client/views/collections/CollectionMenu.tsx
index cfbcec2d6..eb55650e4 100644
--- a/src/client/views/collections/CollectionMenu.tsx
+++ b/src/client/views/collections/CollectionMenu.tsx
@@ -769,6 +769,21 @@ export class CollectionFreeFormViewChrome extends React.Component<CollectionView
return this.selectedDoc?.type === DocumentType.RTF || (RichTextMenu.Instance?.view as any) ? true : false;
}
+ public static gotoKeyFrame(doc: Doc, newFrame: number) {
+ if (!doc) {
+ return;
+ }
+ const dataField = doc[Doc.LayoutFieldKey(doc)];
+ const childDocs = DocListCast(dataField);
+ const currentFrame = Cast(doc._currentFrame, 'number', null);
+ if (currentFrame === undefined) {
+ doc._currentFrame = 0;
+ CollectionFreeFormDocumentView.setupKeyframes(childDocs, 0);
+ }
+ CollectionFreeFormDocumentView.updateKeyframe(childDocs, currentFrame || 0);
+ doc._currentFrame = newFrame === undefined ? 0 : Math.max(0, newFrame);
+ }
+
@undoBatch
@action
nextKeyframe = (): void => {
@@ -1010,7 +1025,7 @@ export class CollectionFreeFormViewChrome extends React.Component<CollectionView
<FontAwesomeIcon icon={'caret-left'} size={'lg'} />
</div>
</Tooltip>
- <Tooltip key="num" title={<div className="dash-tooltip">Toggle View All</div>} placement="bottom">
+ <Tooltip key="num" title={<div className="dash-tooltip">Frame number</div>} placement="bottom">
<div
className="numKeyframe"
style={{ color: this.props.docView.ComponentView?.getKeyFrameEditing?.() ? 'white' : 'black', backgroundColor: this.props.docView.ComponentView?.getKeyFrameEditing?.() ? '#5B9FDD' : '#AEDDF8' }}
@@ -1569,13 +1584,5 @@ export class CollectionGridViewChrome extends React.Component<CollectionViewMenu
}
}
ScriptingGlobals.add(function gotoFrame(doc: any, newFrame: any) {
- const dataField = doc[Doc.LayoutFieldKey(doc)];
- const childDocs = DocListCast(dataField);
- const currentFrame = Cast(doc._currentFrame, 'number', null);
- if (currentFrame === undefined) {
- doc._currentFrame = 0;
- CollectionFreeFormDocumentView.setupKeyframes(childDocs, 0);
- }
- CollectionFreeFormDocumentView.updateKeyframe(childDocs, currentFrame || 0);
- doc._currentFrame = newFrame === undefined ? 0 : Math.max(0, newFrame);
+ CollectionFreeFormViewChrome.gotoKeyFrame(doc, newFrame);
});