mirror of
https://github.com/zadam/trilium.git
synced 2025-11-07 13:56:11 +01:00
closing panes
This commit is contained in:
18
src/public/app/widgets/buttons/close_pane_button.js
Normal file
18
src/public/app/widgets/buttons/close_pane_button.js
Normal 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() }));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user