aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-09-30 16:56:37 -0400
committerbobzel <zzzman@gmail.com>2021-09-30 16:56:37 -0400
commit547a6aef2c35ef427f046f16b54da707e4d3252a (patch)
tree94fdf55c6f19ade30564898a06e9d4147aaf925e
parent271712498ad4021c06a15563c84f99f091696bea (diff)
added back correct labeling of trimmed titles in audiobox
-rw-r--r--src/client/views/collections/CollectionStackedTimeline.tsx8
-rw-r--r--src/client/views/nodes/LabelBox.tsx2
2 files changed, 8 insertions, 2 deletions
diff --git a/src/client/views/collections/CollectionStackedTimeline.tsx b/src/client/views/collections/CollectionStackedTimeline.tsx
index b1afb998b..c83174d87 100644
--- a/src/client/views/collections/CollectionStackedTimeline.tsx
+++ b/src/client/views/collections/CollectionStackedTimeline.tsx
@@ -689,6 +689,12 @@ class StackedTimelineAnchor extends React.Component<StackedTimelineAnchorProps>
super(props);
this._lastTimecode = this.props.currentTimecode();
}
+
+ computeTitle = () => {
+ const start = Math.max(NumCast(this.props.mark[this.props.startTag]), this.props.trimStart) - this.props.trimStart;
+ const end = Math.min(NumCast(this.props.mark[this.props.endTag]), this.props.trimEnd) - this.props.trimStart;
+ return `#${formatTime(start)}-${formatTime(end)}`;
+ }
componentDidMount() {
this._disposer = reaction(
() => this.props.currentTimecode(),
@@ -809,7 +815,7 @@ class StackedTimelineAnchor extends React.Component<StackedTimelineAnchorProps>
DataDoc={undefined}
renderDepth={this.props.renderDepth + 1}
LayoutTemplate={undefined}
- LayoutTemplateString={LabelBox.LayoutString("data")}
+ LayoutTemplateString={LabelBox.LayoutStringWithTitle(LabelBox, "data", this.computeTitle())}
isDocumentActive={this.props.isDocumentActive}
PanelWidth={width}
PanelHeight={height}
diff --git a/src/client/views/nodes/LabelBox.tsx b/src/client/views/nodes/LabelBox.tsx
index c26fd85c9..dae72bb78 100644
--- a/src/client/views/nodes/LabelBox.tsx
+++ b/src/client/views/nodes/LabelBox.tsx
@@ -38,7 +38,7 @@ export class LabelBox extends ViewBoxBaseComponent<(FieldViewProps & LabelBoxPro
}
getTitle() {
- return this.props.label ? this.props.label : this.rootDoc["title-custom"] ? StrCast(this.rootDoc.title) :
+ return this.rootDoc["title-custom"] ? StrCast(this.rootDoc.title) : this.props.label ? this.props.label :
typeof this.rootDoc[this.fieldKey] === "string" ? StrCast(this.rootDoc[this.fieldKey]) : StrCast(this.rootDoc.title);
}