Skip to content

Commit 4c39935

Browse files
committed
Merge branch 'main' into web/v21.0.0
2 parents da313d4 + 3dc3232 commit 4c39935

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

how-to/web-layout/README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fin.Platform.Layout.init({ layoutManagerOverride, container: PARENT_CONTAINER })
6666

6767
This allows us to call a function in the LayoutManager class called applyLayoutSnapshot that takes a container element, id string for its name, and a layout object to inject your snapshot layout in the desired container in the view.
6868

69-
By overriding some of the existing layout functions that you might be used to if you've used our Platform API before, we can now pass an larger object (found in /public/layouts/default.layout.fin.json) with multiple layouts, and iterate the creation of them into the DOM.
69+
By overriding some of the existing layout functions that you might be used to if you've used our Platform API before, we can now pass a larger object (found in /public/layouts/default.layout.fin.json) with multiple layouts, and iterate the creation of them into the DOM.
7070

7171
```javascript
7272
function layoutManagerOverride(Base: LayoutManagerConstructor):
@@ -97,3 +97,13 @@ function layoutManagerOverride(Base: LayoutManagerConstructor):
9797
};
9898
};
9999
```
100+
101+
### Required CSS styles
102+
103+
If the layout does not automatically resize to fill the viewport (both growing and shrinking), then the container does not have the correct css styles applied.
104+
105+
The parent of each layout must have defined dimensions - not proportional sizing such as flexbox or percentage values.
106+
107+
In this example see the `.openfin-layout` class in [app.css](public/common/style/app.css) for how to achieve this.
108+
109+
![Required CSS](./docs/css-classes.png)

how-to/web-layout/client/src/provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ async function createLayout(
181181
// Create a new div container for the layout.
182182
const container = document.createElement("div");
183183
container.id = layoutName;
184-
container.className = "col layout-container";
184+
container.className = "col openfin-layout";
185185
container.style.display = order === 0 ? "block" : "none";
186186
PARENT_CONTAINER?.append(container);
187187

623 KB
Loading

how-to/web-layout/public/common/style/app.css

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,16 @@
4141
--brand-success: var(--theme-status-success, #35c759);
4242
}
4343

44-
.left-panel {
45-
width: var(--left-panel-width);
46-
}
47-
48-
.layout-container {
44+
/* The parent of the lm_root class must have defined dimensions - not proportional sizing such as flexbox or percent values */
45+
.openfin-layout {
4946
height: calc(100dvh - var(--header-height) - (var(--body-padding) * 2) - var(--tab-height));
5047
width: calc(100dvw - var(--left-panel-width) - (var(--body-padding) * 2));
5148
}
5249

50+
.left-panel {
51+
width: var(--left-panel-width);
52+
}
53+
5354
.header {
5455
height: var(--header-height);
5556
}

0 commit comments

Comments
 (0)