From 9af41a75b3b8f114b5297ff83823560425fbd2ac Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 6 Jun 2022 11:11:34 -0400 Subject: fixes for audio box pin with view. --- src/client/views/DocumentButtonBar.tsx | 2 +- src/client/views/nodes/trails/PresBox.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/client/views/DocumentButtonBar.tsx b/src/client/views/DocumentButtonBar.tsx index 25297e167..b2f4b82a4 100644 --- a/src/client/views/DocumentButtonBar.tsx +++ b/src/client/views/DocumentButtonBar.tsx @@ -223,7 +223,7 @@ export class DocumentButtonBar extends React.Component<{ views: () => (DocumentV const scroll = targetDoc._scrollTop; activeDoc.presPinView = true; activeDoc.presPinViewScroll = scroll; - } else if (targetDoc.type === DocumentType.VID) { + } else if ([DocumentType.AUDIO, DocumentType.VID].includes(targetDoc.type as any)) { activeDoc.presPinView = true; activeDoc.presStartTime = targetDoc._currentTimecode; activeDoc.presEndTime = NumCast(targetDoc._currentTimecode) + 0.1; diff --git a/src/client/views/nodes/trails/PresBox.tsx b/src/client/views/nodes/trails/PresBox.tsx index e32f2826f..dea6b818f 100644 --- a/src/client/views/nodes/trails/PresBox.tsx +++ b/src/client/views/nodes/trails/PresBox.tsx @@ -334,7 +334,7 @@ export class PresBox extends ViewBoxBaseComponent() { bestTarget._scrollTop = activeItem.presPinViewScroll; } else if (bestTarget.type === DocumentType.COMPARISON) { bestTarget._clipWidth = activeItem.presPinClipWidth; - } else if (bestTarget.type === DocumentType.VID) { + } else if ([DocumentType.AUDIO, DocumentType.VID].includes(bestTarget.type as any)) { bestTarget._currentTimecode = activeItem.presStartTime; } else { bestTarget._viewTransition = activeItem.presTransition ? `transform ${activeItem.presTransition}ms` : 'all 0.5s'; @@ -1363,7 +1363,7 @@ export class PresBox extends ViewBoxBaseComponent() { const scroll = targetDoc._scrollTop; activeItem.presPinView = true; activeItem.presPinViewScroll = scroll; - } else if (targetDoc.type === DocumentType.VID) { + } else if ([DocumentType.AUDIO, DocumentType.VID].includes(targetDoc.type as any)) { activeItem.presStartTime = targetDoc._currentTimecode; activeItem.presEndTime = NumCast(targetDoc._currentTimecode) + 0.1; } else if ((targetDoc.type === DocumentType.COL && targetDoc._viewType === CollectionViewType.Freeform) || targetDoc.type === DocumentType.IMG) { @@ -1386,7 +1386,7 @@ export class PresBox extends ViewBoxBaseComponent() { if (targetDoc.type === DocumentType.PDF || targetDoc.type === DocumentType.WEB || targetDoc.type === DocumentType.RTF) { const scroll = targetDoc._scrollTop; activeItem.presPinViewScroll = scroll; - } else if (targetDoc.type === DocumentType.VID) { + } else if ([DocumentType.AUDIO, DocumentType.VID].includes(targetDoc.type as any)) { activeItem.presStartTime = targetDoc._currentTimecode; activeItem.presStartTime = NumCast(targetDoc._currentTimecode) + 0.1; } else if (targetDoc.type === DocumentType.COMPARISON) { -- cgit v1.2.3-70-g09d2