mirror of
https://github.com/zadam/trilium.git
synced 2025-11-09 23:05:51 +01:00
fix all launcher bar components
This commit is contained in:
@@ -1,17 +1,19 @@
|
||||
import BasicWidget from "../basic_widget.js";
|
||||
|
||||
const TPL = `
|
||||
<div class="dropdown right-dropdown-widget dropright">
|
||||
<div class="dropdown right-dropdown-widget dropend">
|
||||
<style>
|
||||
.right-dropdown-widget {
|
||||
height: 53px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<button type="button" data-toggle="dropdown" data-placement="right"
|
||||
<button type="button" data-bs-toggle="dropdown" data-placement="right"
|
||||
aria-haspopup="true" aria-expanded="false"
|
||||
class="bx right-dropdown-button launcher-button"></button>
|
||||
|
||||
<div class="tooltip-trigger"></div>
|
||||
|
||||
<div class="dropdown-menu dropdown-menu-right"></div>
|
||||
</div>
|
||||
`;
|
||||
@@ -29,11 +31,14 @@ export default class RightDropdownButtonWidget extends BasicWidget {
|
||||
this.$widget = $(TPL);
|
||||
this.$dropdownMenu = this.$widget.find(".dropdown-menu");
|
||||
|
||||
const $button = this.$widget.find(".right-dropdown-button")
|
||||
this.$tooltip = this.$widget.find(".tooltip-trigger").attr("title", this.title);
|
||||
this.tooltip = new bootstrap.Tooltip(this.$tooltip);
|
||||
|
||||
this.$widget.find(".right-dropdown-button")
|
||||
.addClass(this.iconClass)
|
||||
.attr("title", this.title)
|
||||
.tooltip({ trigger: "hover" })
|
||||
.on("click", () => $button.tooltip("hide"));
|
||||
.on("click", () => this.tooltip.hide())
|
||||
.on('mouseenter', () => this.tooltip.show())
|
||||
.on('mouseleave', () => this.tooltip.hide());
|
||||
|
||||
this.$widget.on('show.bs.dropdown', async () => {
|
||||
await this.dropdownShown();
|
||||
@@ -51,10 +56,5 @@ export default class RightDropdownButtonWidget extends BasicWidget {
|
||||
}
|
||||
|
||||
// to be overridden
|
||||
async dropdownShow() {}
|
||||
|
||||
hideDropdown() {
|
||||
this.$widget.dropdown("hide");
|
||||
this.$dropdownMenu.removeClass("show");
|
||||
}
|
||||
async dropdownShow() { }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user