closing panes

This commit is contained in:
zadam
2021-05-24 22:29:49 +02:00
parent 2f5d3729de
commit 5707b7e29a
14 changed files with 94 additions and 107 deletions

View File

@@ -0,0 +1,18 @@
import ButtonWidget from "./button_widget.js";
export default class ClosePaneButton extends ButtonWidget {
isEnabled() {
return super.isEnabled()
// main note context should not be closeable
&& this.noteContext && !!this.noteContext.mainNtxId;
}
constructor() {
super();
this.icon("bx-x")
.title("Close this pane")
.titlePlacement("bottom")
.onClick(widget => widget.triggerCommand("closeThisPane", { ntxId: widget.getNtxId() }));
}
}