Skip to content

Build your personal knowledge base with Trilium Notes

fix(client): tooltip position for hide left pane button

Elian Doran7e5fea8cd269
diff --git a/src/public/app/layouts/desktop_layout.js b/src/public/app/layouts/desktop_layout.js
index 6273e8e4a1..223068f4a5 100644
--- a/src/public/app/layouts/desktop_layout.js
+++ b/src/public/app/layouts/desktop_layout.js
@@ -239,16 +239,16 @@ export default class DesktopLayout {
launcherPane = new FlexContainer("row")
.css("height", "53px")
.class("horizontal")
- .child(new LeftPaneToggleWidget())
- .child(new LauncherContainer(isHorizontal))
+ .child(new LeftPaneToggleWidget(true))
+ .child(new LauncherContainer(true))
.child(new GlobalMenuWidget(true))
} else {
launcherPane = new FlexContainer("column")
.css("width", "53px")
.class("vertical")
.child(new GlobalMenuWidget(false))
- .child(new LauncherContainer(isHorizontal))
- .child(new LeftPaneToggleWidget());
+ .child(new LauncherContainer(false))
+ .child(new LeftPaneToggleWidget(false));
}
launcherPane.id("launcher-pane");
diff --git a/src/public/app/widgets/buttons/abstract_button.js b/src/public/app/widgets/buttons/abstract_button.js
index 38b47429b9..98236d5a8d 100644
--- a/src/public/app/widgets/buttons/abstract_button.js
+++ b/src/public/app/widgets/buttons/abstract_button.js
@@ -26,7 +26,8 @@ export default class AbstractButtonWidget extends NoteContextAwareWidget {
html: true,
title: () => this.getTitle(),
trigger: 'hover',
- placement: this.settings.titlePlacement
+ placement: this.settings.titlePlacement,
+ fallbackPlacements: [ this.settings.titlePlacement ]
})
if (this.settings.onContextMenu) {
diff --git a/src/public/app/widgets/buttons/left_pane_toggle.js b/src/public/app/widgets/buttons/left_pane_toggle.js
index 82a4758b56..eb5f153767 100644
--- a/src/public/app/widgets/buttons/left_pane_toggle.js
+++ b/src/public/app/widgets/buttons/left_pane_toggle.js
@@ -4,7 +4,7 @@ import CommandButtonWidget from "./command_button.js";
import { t } from "../../services/i18n.js";
export default class LeftPaneToggleWidget extends CommandButtonWidget {
- constructor() {
+ constructor(isHorizontalLayout) {
super();
this.class("launcher-button");
@@ -20,6 +20,11 @@ export default class LeftPaneToggleWidget extends CommandButtonWidget {
this.settings.command = () => options.is('leftPaneVisible')
? "hideLeftPane"
: "showLeftPane";
+
+ if (isHorizontalLayout) {
+ this.settings.titlePlacement = "bottom";
+ }
+ console.log(this.settings);
}
refreshIcon() {