Skip to content

Build your personal knowledge base with Trilium Notes

feat(mobile): force horizontal layout on mobile

Elian Doran23a8023f0bdc
diff --git a/src/public/app/layouts/mobile_layout.js b/src/public/app/layouts/mobile_layout.js
index adb5424159..1632e5283d 100644
--- a/src/public/app/layouts/mobile_layout.js
+++ b/src/public/app/layouts/mobile_layout.js
@@ -98,9 +98,9 @@ span.fancytree-expander {
border-style: solid;
}
-.tree-wrapper .collapse-tree-button,
-.tree-wrapper .scroll-to-active-note-button,
-.tree-wrapper .tree-settings-button {
+.tree-wrapper .collapse-tree-button,
+.tree-wrapper .scroll-to-active-note-button,
+.tree-wrapper .tree-settings-button {
position: fixed;
margin-right: 16px;
display: none;
@@ -113,13 +113,18 @@ span.fancytree-expander {
export default class MobileLayout {
getRootWidget(appContext) {
- const launcherPaneIsHorizontal = (options.get("layoutOrientation") === "horizontal");
+ const launcherPaneIsHorizontal = true;
- return new RootContainer(launcherPaneIsHorizontal)
+ return new RootContainer(true)
.setParent(appContext)
- .class((launcherPaneIsHorizontal ? "horizontal" : "vertical") + "-layout")
+ .class("horizontal-layout")
.cssBlock(MOBILE_CSS)
- .child(this.#buildLauncherPane(launcherPaneIsHorizontal))
+ .child(new FlexContainer("row")
+ .class("horizontal")
+ .css("height", "53px")
+ .child(new LauncherContainer(true))
+ .child(new GlobalMenuWidget(true))
+ .id("launcher-pane"))
.child(new FlexContainer("row")
.filling()
.child(new ScreenContainer("tree", 'column')
@@ -139,14 +144,13 @@ export default class MobileLayout {
.child(new FlexContainer('row').contentSized()
.css('font-size', 'larger')
.css('align-items', 'center')
- .optChild(!launcherPaneIsHorizontal, new MobileDetailMenuWidget(false).contentSized())
.child(new NoteTitleWidget()
.contentSized()
.css("position: relative;")
.css("top: 5px;")
- .optCss(launcherPaneIsHorizontal, "padding-left", "0.5em")
+ .css("padding-left", "0.5em")
)
- .optChild(launcherPaneIsHorizontal, new MobileDetailMenuWidget(true).contentSized())
+ .child(new MobileDetailMenuWidget(true).contentSized())
.child(new CloseDetailButtonWidget().contentSized()))
.child(new SharedInfoWidget())
.child(new FloatingButtons()
@@ -175,25 +179,4 @@ export default class MobileLayout {
.child(new ConfirmDialog())
);
}
-
- #buildLauncherPane(isHorizontal) {
- let launcherPane;
-
- if (isHorizontal) {
- launcherPane = new FlexContainer("row")
- .class("horizontal")
- .css("height", "53px")
- .child(new LauncherContainer(true))
- .child(new GlobalMenuWidget(true));
- } else {
- launcherPane = new FlexContainer("column")
- .class("vertical")
- .css("width", "53px")
- .child(new GlobalMenuWidget(false))
- .child(new LauncherContainer(false));
- }
-
- launcherPane.id("launcher-pane");
- return launcherPane;
- }
}