mirror of
https://github.com/zadam/trilium.git
synced 2025-11-10 15:25:51 +01:00
Merge branch 'master' into next61
# Conflicts: # src/becca/entities/bnote.js # src/public/app/components/note_context.js # src/public/app/layouts/desktop_layout.js # src/public/app/services/note_content_renderer.js # src/public/app/services/utils.js # src/public/app/widgets/ribbon_widgets/file_properties.js # src/public/app/widgets/ribbon_widgets/note_info_widget.js # src/services/notes.js
This commit is contained in:
@@ -7,6 +7,10 @@ export default class ClosePaneButton extends OnClickButtonWidget {
|
||||
&& this.noteContext && !!this.noteContext.mainNtxId;
|
||||
}
|
||||
|
||||
async noteContextReorderEvent({ntxIdsInOrder}) {
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
||||
47
src/public/app/widgets/buttons/move_pane_button.js
Normal file
47
src/public/app/widgets/buttons/move_pane_button.js
Normal file
@@ -0,0 +1,47 @@
|
||||
import OnClickButtonWidget from "./onclick_button.js";
|
||||
import appContext from "../../components/app_context.js";
|
||||
|
||||
export default class MovePaneButton extends OnClickButtonWidget {
|
||||
constructor(isMovingLeft) {
|
||||
super();
|
||||
|
||||
this.isMovingLeft = isMovingLeft;
|
||||
|
||||
this.icon(isMovingLeft ? "bx-chevron-left" : "bx-chevron-right")
|
||||
.title(isMovingLeft ? "Move left" : "Move right")
|
||||
.titlePlacement("bottom")
|
||||
.onClick(async (widget, e) => {
|
||||
e.stopPropagation();
|
||||
widget.triggerCommand("moveThisNoteSplit", {ntxId: widget.getClosestNtxId(), isMovingLeft: this.isMovingLeft});
|
||||
})
|
||||
.class("icon-action");
|
||||
}
|
||||
|
||||
isEnabled() {
|
||||
if (!super.isEnabled()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.isMovingLeft) {
|
||||
// movable if the current context is not a main context, i.e. non-null mainNtxId
|
||||
return !!this.noteContext?.mainNtxId;
|
||||
} else {
|
||||
const currentIndex = appContext.tabManager.noteContexts.findIndex(c => c.ntxId === this.ntxId);
|
||||
const nextContext = appContext.tabManager.noteContexts[currentIndex + 1];
|
||||
// movable if the next context is not null and not a main context, i.e. non-null mainNtxId
|
||||
return !!nextContext?.mainNtxId;
|
||||
}
|
||||
}
|
||||
|
||||
async noteContextRemovedEvent() {
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
async newNoteContextCreatedEvent() {
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
async noteContextReorderEvent() {
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user