mirror of
https://github.com/zadam/trilium.git
synced 2025-11-05 04:45:47 +01:00
fix(client): global menu alignment on horizontal layout
This commit is contained in:
@@ -5,7 +5,7 @@ import UpdateAvailableWidget from "./update_available.js";
|
|||||||
import options from "../../services/options.js";
|
import options from "../../services/options.js";
|
||||||
|
|
||||||
const TPL = `
|
const TPL = `
|
||||||
<div class="dropdown global-menu dropend">
|
<div class="dropdown global-menu">
|
||||||
<style>
|
<style>
|
||||||
.global-menu {
|
.global-menu {
|
||||||
width: 53px;
|
width: 53px;
|
||||||
@@ -253,12 +253,16 @@ export default class GlobalMenuWidget extends BasicWidget {
|
|||||||
super();
|
super();
|
||||||
|
|
||||||
this.updateAvailableWidget = new UpdateAvailableWidget();
|
this.updateAvailableWidget = new UpdateAvailableWidget();
|
||||||
this.isHorizontalLayout = isHorizontalLayout;
|
this.isHorizontalLayout = isHorizontalLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
doRender() {
|
doRender() {
|
||||||
this.$widget = $(TPL);
|
this.$widget = $(TPL);
|
||||||
|
|
||||||
|
if (!this.isHorizontalLayout) {
|
||||||
|
this.$widget.addClass("dropend");
|
||||||
|
}
|
||||||
|
|
||||||
const $globalMenuButton = this.$widget.find(".global-menu-button")
|
const $globalMenuButton = this.$widget.find(".global-menu-button")
|
||||||
if (!this.isHorizontalLayout) {
|
if (!this.isHorizontalLayout) {
|
||||||
$globalMenuButton.prepend($(`\
|
$globalMenuButton.prepend($(`\
|
||||||
@@ -282,7 +286,9 @@ export default class GlobalMenuWidget extends BasicWidget {
|
|||||||
$globalMenuButton.toggleClass("bx bx-menu");
|
$globalMenuButton.toggleClass("bx bx-menu");
|
||||||
}
|
}
|
||||||
|
|
||||||
this.dropdown = bootstrap.Dropdown.getOrCreateInstance(this.$widget.find("[data-bs-toggle='dropdown']"));
|
this.dropdown = bootstrap.Dropdown.getOrCreateInstance(this.$widget.find("[data-bs-toggle='dropdown']"), {
|
||||||
|
alignment: "bottom"
|
||||||
|
});
|
||||||
|
|
||||||
this.$widget.find(".show-about-dialog-button").on('click', () => this.triggerCommand("openAboutDialog"));
|
this.$widget.find(".show-about-dialog-button").on('click', () => this.triggerCommand("openAboutDialog"));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user