mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
don't try to activate the pane being currently removed
This commit is contained in:
parent
f505f9d65a
commit
53875d26bc
@ -26,16 +26,16 @@ export default class ButtonWidget extends NoteContextAwareWidget {
|
||||
this.$widget = $(TPL);
|
||||
|
||||
if (this.settings.onClick) {
|
||||
this.$widget.on("click", () => {
|
||||
this.$widget.on("click", e => {
|
||||
this.$widget.tooltip("hide");
|
||||
|
||||
this.settings.onClick(this)
|
||||
this.settings.onClick(this, e);
|
||||
});
|
||||
} else {
|
||||
this.$widget.on("click", () => {
|
||||
this.$widget.tooltip("hide");
|
||||
|
||||
this.triggerCommand(this.settings.command)
|
||||
this.triggerCommand(this.settings.command);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,12 @@ export default class ClosePaneButton extends ButtonWidget {
|
||||
this.icon("bx-x")
|
||||
.title("Close this pane")
|
||||
.titlePlacement("bottom")
|
||||
.onClick(widget => widget.triggerCommand("closeThisNoteSplit", { ntxId: widget.getNtxId() }));
|
||||
.onClick((widget, e) => {
|
||||
// to avoid split pane container detecting click within the pane which would try to activate this
|
||||
// pane (which is being removed)
|
||||
e.stopPropagation();
|
||||
|
||||
widget.triggerCommand("closeThisNoteSplit", { ntxId: widget.getNtxId() });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user