diff options
author | bobzel <zzzman@gmail.com> | 2023-12-01 12:17:10 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-12-01 12:17:10 -0500 |
commit | 678abdfceaa25cb84c4232f44a7c161b6d39b546 (patch) | |
tree | 3ee85b4796619d06949daa964556d19ed0a98830 /src/client/views/nodes/LabelBox.tsx | |
parent | 9ae07e29f41df9d64985c25b67054843a99a0224 (diff) |
cleaning up documentview props. got rid of special cases for keyValueBox. made fitToContents work cleanly for native scaled docs.
Diffstat (limited to 'src/client/views/nodes/LabelBox.tsx')
-rw-r--r-- | src/client/views/nodes/LabelBox.tsx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/views/nodes/LabelBox.tsx b/src/client/views/nodes/LabelBox.tsx index 0d7b2b0a4..e1421878b 100644 --- a/src/client/views/nodes/LabelBox.tsx +++ b/src/client/views/nodes/LabelBox.tsx @@ -36,7 +36,7 @@ export class LabelBox extends ViewBoxBaseComponent<FieldViewProps & LabelBoxProp this._timeout && clearTimeout(this._timeout); } - getTitle() { + @computed get Title() { return this.dataDoc.title_custom ? StrCast(this.Document.title) : this.props.label ? this.props.label : typeof this.dataDoc[this.fieldKey] === 'string' ? StrCast(this.dataDoc[this.fieldKey]) : StrCast(this.Document.title); } @@ -119,7 +119,7 @@ export class LabelBox extends ViewBoxBaseComponent<FieldViewProps & LabelBoxProp const params = Cast(this.paramsDoc['onClick-paramFieldKeys'], listSpec('string'), []); const missingParams = params?.filter(p => !this.paramsDoc[p]); params?.map(p => DocListCast(this.paramsDoc[p])); // bcz: really hacky form of prefetching ... - const label = this.getTitle(); + const label = this.Title; return ( <div className="labelBox-outerDiv" |