aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/views/nodes/PresBox.tsx2
-rw-r--r--src/client/views/presentationview/PresElementBox.scss10
-rw-r--r--src/client/views/presentationview/PresElementBox.tsx14
3 files changed, 19 insertions, 7 deletions
diff --git a/src/client/views/nodes/PresBox.tsx b/src/client/views/nodes/PresBox.tsx
index c661b7f4e..06d8e688b 100644
--- a/src/client/views/nodes/PresBox.tsx
+++ b/src/client/views/nodes/PresBox.tsx
@@ -333,7 +333,7 @@ export class PresBox extends React.Component<FieldViewProps> {
@action
initializeScaleViews = (docList: Doc[], viewtype: number) => {
this.props.Document._chromeStatus = "disabled";
- const hgt = (viewtype === CollectionViewType.Tree) ? 50 : 42;
+ const hgt = (viewtype === CollectionViewType.Tree) ? 50 : 46;
docList.forEach((doc: Doc) => {
doc.presBox = this.props.Document;
doc.presBoxKey = this.props.fieldKey;
diff --git a/src/client/views/presentationview/PresElementBox.scss b/src/client/views/presentationview/PresElementBox.scss
index b74b07224..86ad8fed6 100644
--- a/src/client/views/presentationview/PresElementBox.scss
+++ b/src/client/views/presentationview/PresElementBox.scss
@@ -4,6 +4,7 @@
background-color: #eeeeee;
pointer-events: all;
width: 100%;
+ height: 100%;
outline-color: maroon;
outline-style: dashed;
border-radius: 6px;
@@ -17,7 +18,6 @@
padding: 0px;
padding-left: 5px;
padding-bottom: 3px;
-
.documentView-node {
position: absolute;
z-index: 1;
@@ -82,7 +82,13 @@
.presElementBox-embedded {
position: relative;
- margin-top: 30;
+ margin-top: 22;
+ display: flex;
+ justify-content: center;
+ .contentFittingDocumentView {
+ position: absolute;
+ height: 100%;
+ }
}
.presElementBox-embeddedMask {
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}
/>