diff options
| author | Bob Zeleznik <zzzman@gmail.com> | 2020-02-01 17:32:31 -0500 |
|---|---|---|
| committer | Bob Zeleznik <zzzman@gmail.com> | 2020-02-01 17:32:31 -0500 |
| commit | 1a25ad93d107755320b319db999a1489982e3597 (patch) | |
| tree | 5878aad16fec84e65f71859cc484a35962fec903 /src/client/views/presentationview/PresElementBox.tsx | |
| parent | 693665069c170983bd76336b804ec73870642fe3 (diff) | |
presenetation bug fixes
Diffstat (limited to 'src/client/views/presentationview/PresElementBox.tsx')
| -rw-r--r-- | src/client/views/presentationview/PresElementBox.tsx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/client/views/presentationview/PresElementBox.tsx b/src/client/views/presentationview/PresElementBox.tsx index afc88833e..ab49fbf1e 100644 --- a/src/client/views/presentationview/PresElementBox.tsx +++ b/src/client/views/presentationview/PresElementBox.tsx @@ -174,13 +174,19 @@ export class PresElementBox extends DocExtendableComponent<FieldViewProps, PresD const propDocWidth = NumCast(this.layoutDoc._nativeWidth); const propDocHeight = NumCast(this.layoutDoc._nativeHeight); const scale = () => 175 / NumCast(this.layoutDoc._nativeWidth, 175); + const layoutDoc = Doc.Layout(this.props.Document); + if (!layoutDoc.embeddedView) { + layoutDoc.embeddedView = Doc.MakeAlias(this.originalLayout); + (layoutDoc.embeddedView as Doc).layoutKey = "layout"; + } + const embedHeight = propDocHeight === 0 ? this.props.PanelHeight() - NumCast(this.originalLayout.collapsedHeight) : propDocHeight * scale(); return ( <div className="presElementBox-embedded" style={{ - height: propDocHeight === 0 ? NumCast(this.layoutDoc._height) - NumCast(this.layoutDoc.collapsedHeight) : propDocHeight * scale(), + height: embedHeight, width: propDocWidth === 0 ? "auto" : propDocWidth * scale(), }}> <ContentFittingDocumentView - Document={this.props.Document} + Document={layoutDoc.embeddedView as Doc} DataDocument={this.props.DataDoc} LibraryPath={emptyPath} fitToBox={StrCast(this.targetDoc.type).indexOf(DocumentType.COL) !== -1} @@ -189,11 +195,11 @@ export class PresElementBox extends DocExtendableComponent<FieldViewProps, PresD addDocTab={returnFalse} pinToPres={returnFalse} PanelWidth={() => this.props.PanelWidth() - 20} - PanelHeight={() => 100} + PanelHeight={() => embedHeight} getTransform={Transform.Identity} active={this.props.active} moveDocument={this.props.moveDocument!} - renderDepth={1} + renderDepth={this.props.renderDepth + 1} focus={emptyFunction} whenActiveChanged={returnFalse} /> |
