diff options
| author | bobzel <zzzman@gmail.com> | 2022-03-02 14:43:48 -0500 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2022-03-02 14:43:48 -0500 |
| commit | 398a50bc1d7e77691620a4a6752fd38d4bb391b0 (patch) | |
| tree | 42f56a2bc7cc1d661c3dfa61d49cc472fffb553c /src/client/views/nodes/DocumentView.tsx | |
| parent | 35f0c9940d0ea7c0cb37c711557454b77ac038ad (diff) | |
upgraded to typescript 4.6.2
Diffstat (limited to 'src/client/views/nodes/DocumentView.tsx')
| -rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 67486dcf4..e2380bfba 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -1025,19 +1025,18 @@ export class DocumentViewInternal extends DocComponent<DocumentViewInternalProps display={"block"} fontSize={10} GetValue={() => showTitle.split(";").length === 1 ? showTitle + "=" + Field.toString(targetDoc[showTitle.split(";")[0]] as any as Field) : "#" + showTitle} - SetValue={undoBatch(input => { + SetValue={undoBatch((input: string) => { if (input?.startsWith("#")) { if (this.props.showTitle) { this.rootDoc._showTitle = input?.substring(1) ? input.substring(1) : undefined; } else { Doc.UserDoc().showTitle = input?.substring(1) ? input.substring(1) : "creationDate"; } - return true; } else { - var value = input.replace(new RegExp(showTitle + "="), ""); + var value = input.replace(new RegExp(showTitle + "="), "") as string | number; if (showTitle !== "title" && Number(value).toString() === value) value = Number(value); if (showTitle.includes("Date") || showTitle === "author") return true; - return Doc.SetInPlace(targetDoc, showTitle, value, true) ? true : true; + Doc.SetInPlace(targetDoc, showTitle, value, true); } return true; })} @@ -1148,7 +1147,7 @@ export class DocumentView extends React.Component<DocumentViewProps> { get LayoutFieldKey() { return this.docView?.LayoutFieldKey || "layout"; } get fitWidth() { return this.props.fitWidth?.(this.rootDoc) || this.layoutDoc.fitWidth; } - @computed get docViewPath() { return this.props.docViewPath ? [...this.props.docViewPath(), this] : [this]; } + @computed get docViewPath(): DocumentView[] { return this.props.docViewPath ? [...this.props.docViewPath(), this] : [this]; } @computed get layoutDoc() { return Doc.Layout(this.Document, this.props.LayoutTemplate?.()); } @computed get nativeWidth() { return this.docView?._componentView?.reverseNativeScaling?.() ? 0 : |
