hide tooltip after clicking on a button, fixes #2228

This commit is contained in:
zadam
2021-10-13 23:05:47 +02:00
parent 6434889cd6
commit f505f9d65a
3 changed files with 31 additions and 23 deletions

View File

@@ -26,9 +26,17 @@ export default class ButtonWidget extends NoteContextAwareWidget {
this.$widget = $(TPL);
if (this.settings.onClick) {
this.$widget.on("click", () => this.settings.onClick(this));
this.$widget.on("click", () => {
this.$widget.tooltip("hide");
this.settings.onClick(this)
});
} else {
this.$widget.on("click", () => this.triggerCommand(this.settings.command));
this.$widget.on("click", () => {
this.$widget.tooltip("hide");
this.triggerCommand(this.settings.command)
});
}
this.$widget.attr("data-placement", this.settings.titlePlacement);