mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
19 lines
538 B
JavaScript
19 lines
538 B
JavaScript
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() }));
|
|
}
|
|
}
|