From f79e47041928648d0ad9ffb93ef053bde98c1622 Mon Sep 17 00:00:00 2001 From: bobzel Date: Sat, 13 Feb 2021 22:42:41 -0500 Subject: fixed videobox focus issues when following a link so that video is focused in frame before annotation is focused. --- src/client/views/collections/CollectionStackedTimeline.tsx | 7 ++++++- src/client/views/nodes/DocumentView.tsx | 1 + src/client/views/nodes/VideoBox.tsx | 1 - 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/CollectionStackedTimeline.tsx b/src/client/views/collections/CollectionStackedTimeline.tsx index 968ff3cd8..efbab3ede 100644 --- a/src/client/views/collections/CollectionStackedTimeline.tsx +++ b/src/client/views/collections/CollectionStackedTimeline.tsx @@ -17,6 +17,7 @@ import { CollectionSubView } from "../collections/CollectionSubView"; import { DocumentView } from "../nodes/DocumentView"; import { LabelBox } from "../nodes/LabelBox"; import "./CollectionStackedTimeline.scss"; +import { Transform } from "../../util/Transform"; type PanZoomDocument = makeInterface<[]>; const PanZoomDocument = makeInterface(); @@ -256,6 +257,10 @@ export class CollectionStackedTimeline extends CollectionSubView ScriptField), doublescript: undefined | (() => ScriptField), x: number, y: number, width: number, height: number) { const anchor = observable({ view: undefined as any }); + const focusFunc = (doc: Doc, willZoom?: boolean, scale?: number, afterFocus?: (notFocused: boolean) => Promise, docTransform?: Transform) => { + this.props.playLink(mark); + this.props.focus(doc, willZoom, scale, afterFocus, docTransform); + } return { anchor, view: anchor.view = r)} @@ -267,7 +272,7 @@ export class CollectionStackedTimeline extends CollectionSubView width} PanelHeight={() => height} ScreenToLocalTransform={() => this.props.ScreenToLocalTransform().translate(-x, -y)} - focus={() => this.props.playLink(mark)} + focus={focusFunc} parentActive={out => this.props.isSelected(out) || this.props.isChildActive()} rootSelected={returnFalse} onClick={script} diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 7ba0d7043..9801de1a2 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -645,6 +645,7 @@ export class DocumentViewInternal extends DocComponent this.Document.onClick = ScriptField.MakeScript(`toggleDetail(self, "${this.Document.layoutKey}")`), icon: "concierge-bell" }); + onClicks.push({ description: (this.Document.followLinkZoom ? "Don't" : "") + " zoom following link", event: () => this.Document.followLinkZoom = !this.Document.followLinkZoom, icon: this.Document.ignoreClick ? "unlock" : "lock" }); if (!this.Document.annotationOn) { const options = cm.findByDescription("Options..."); diff --git a/src/client/views/nodes/VideoBox.tsx b/src/client/views/nodes/VideoBox.tsx index 6d0a200cb..435563255 100644 --- a/src/client/views/nodes/VideoBox.tsx +++ b/src/client/views/nodes/VideoBox.tsx @@ -496,7 +496,6 @@ export class VideoBox extends ViewBoxAnnotatableComponent