hide global menu after changing note/context

This commit is contained in:
zadam 2023-03-24 09:32:06 +01:00
parent 0b270ee87a
commit fd8a2d4d92

View File

@ -230,6 +230,7 @@ export default class GlobalMenuWidget extends BasicWidget {
doRender() {
this.$widget = $(TPL);
this.$dropdown = this.$widget.find("[data-toggle='dropdown']");
const $button = this.$widget.find(".global-menu-button");
$button.tooltip({ trigger: "hover" });
$button.on("click", () => $button.tooltip("hide"));
@ -248,7 +249,7 @@ export default class GlobalMenuWidget extends BasicWidget {
return;
}
this.$widget.find("[data-toggle='dropdown']").dropdown('toggle');
this.$dropdown.dropdown('toggle');
});
this.$widget.find(".global-menu-button-update-available").append(
@ -310,4 +311,12 @@ export default class GlobalMenuWidget extends BasicWidget {
downloadLatestVersionCommand() {
window.open("https://github.com/zadam/trilium/releases/latest");
}
activeContextChangedEvent() {
this.$dropdown.dropdown('hide');
}
noteSwitchedEvent() {
this.$dropdown.dropdown('hide');
}
}