aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DocumentView.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/DocumentView.tsx')
-rw-r--r--src/client/views/nodes/DocumentView.tsx10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index 29f658eca..c58362f6c 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -759,7 +759,15 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu
return (showTitle && !showTitleHover ? 0 : 0) + 1;
}
- @computed get finalLayoutKey() { return this.props.layoutKey || "layout"; }
+ @computed get finalLayoutKey() {
+ const { layoutKey } = this.props;
+ if (typeof layoutKey === "string") {
+ return layoutKey;
+ }
+ // return "layout";
+ const fallback = Cast(this.props.Document.layoutKey, "string");
+ return typeof fallback === "string" ? fallback : "layout";
+ }
childScaling = () => (this.layoutDoc.fitWidth ? this.props.PanelWidth() / this.nativeWidth : this.props.ContentScaling());
@computed get contents() {
TraceMobx();