Skip to content

Build your personal knowledge base with Trilium Notes

fix(mobile): vertical layout not sized properly

Elian Doranba5371d76bde
diff --git a/src/public/app/layouts/desktop_layout.js b/src/public/app/layouts/desktop_layout.js
index e3754a596f..42b04d9df4 100644
--- a/src/public/app/layouts/desktop_layout.js
+++ b/src/public/app/layouts/desktop_layout.js
@@ -96,7 +96,7 @@ export default class DesktopLayout {
const launcherPaneIsHorizontal = (options.get("layoutOrientation") === "horizontal");
const launcherPane = this.#buildLauncherPane(launcherPaneIsHorizontal);
- return new RootContainer()
+ return new RootContainer(launcherPaneIsHorizontal)
.setParent(appContext)
.optChild(launcherPaneIsHorizontal, new FlexContainer('row')
.child(new TabRowWidget().class("full-width"))
diff --git a/src/public/app/layouts/mobile_layout.js b/src/public/app/layouts/mobile_layout.js
index 2d6b40cc63..3973081375 100644
--- a/src/public/app/layouts/mobile_layout.js
+++ b/src/public/app/layouts/mobile_layout.js
@@ -115,7 +115,7 @@ export default class MobileLayout {
getRootWidget(appContext) {
const launcherPaneIsHorizontal = (options.get("layoutOrientation") === "horizontal");
- return new RootContainer()
+ return new RootContainer(launcherPaneIsHorizontal)
.setParent(appContext)
.cssBlock(MOBILE_CSS)
.child(this.#buildLauncherPane(launcherPaneIsHorizontal))
@@ -178,13 +178,13 @@ export default class MobileLayout {
let launcherPane;
if (isHorizontal) {
- launcherPane = new FlexContainer(isHorizontal ? "row" : "column")
+ launcherPane = new FlexContainer("row")
.class("horizontal")
.css("height", "53px")
.child(new LauncherContainer(true))
.child(new GlobalMenuWidget(true));
} else {
- launcherPane = new FlexContainer(launcherPaneIsHorizontal ? "row" : "column")
+ launcherPane = new FlexContainer("column")
.class("vertical")
.css("width", "53px")
.child(new GlobalMenuWidget(false))
diff --git a/src/public/app/widgets/containers/root_container.js b/src/public/app/widgets/containers/root_container.js
index e6a4a4a7a5..23dcf1ac21 100644
--- a/src/public/app/widgets/containers/root_container.js
+++ b/src/public/app/widgets/containers/root_container.js
@@ -1,8 +1,8 @@
import FlexContainer from "./flex_container.js";
export default class RootContainer extends FlexContainer {
- constructor() {
- super('column');
+ constructor(isHorizontalLayout) {
+ super(isHorizontalLayout ? "column" : "row");
this.id('root-widget');
this.css('height', '100%');