mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
note hoisting should be done on "hovered", not active note, closes #2124
This commit is contained in:
parent
81a59f48e6
commit
bf4776a33c
@ -7,6 +7,7 @@ import Component from "../widgets/component.js";
|
|||||||
import toastService from "./toast.js";
|
import toastService from "./toast.js";
|
||||||
import ws from "./ws.js";
|
import ws from "./ws.js";
|
||||||
import bundleService from "./bundle.js";
|
import bundleService from "./bundle.js";
|
||||||
|
import froca from "./froca.js";
|
||||||
|
|
||||||
export default class Entrypoints extends Component {
|
export default class Entrypoints extends Component {
|
||||||
constructor() {
|
constructor() {
|
||||||
@ -46,14 +47,15 @@ export default class Entrypoints extends Component {
|
|||||||
appContext.triggerEvent('focusAndSelectTitle', {isNewNote: true});
|
appContext.triggerEvent('focusAndSelectTitle', {isNewNote: true});
|
||||||
}
|
}
|
||||||
|
|
||||||
async toggleNoteHoistingCommand() {
|
async toggleNoteHoistingCommand({noteId = appContext.tabManager.getActiveContextNoteId()}) {
|
||||||
const noteContext = appContext.tabManager.getActiveContext();
|
const noteToHoist = await froca.getNote(noteId);
|
||||||
|
const activeNoteContext = appContext.tabManager.getActiveContext();
|
||||||
|
|
||||||
if (noteContext.note.noteId === noteContext.hoistedNoteId) {
|
if (noteToHoist.noteId === activeNoteContext.hoistedNoteId) {
|
||||||
await noteContext.unhoist();
|
await activeNoteContext.unhoist();
|
||||||
}
|
}
|
||||||
else if (noteContext.note.type !== 'search') {
|
else if (noteToHoist.type !== 'search') {
|
||||||
await noteContext.setHoistedNoteId(noteContext.note.noteId);
|
await activeNoteContext.setHoistedNoteId(noteId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,6 +133,7 @@ class TreeContextMenu {
|
|||||||
this.treeWidget.triggerCommand(command, {
|
this.treeWidget.triggerCommand(command, {
|
||||||
node: this.node,
|
node: this.node,
|
||||||
notePath: notePath,
|
notePath: notePath,
|
||||||
|
noteId: this.node.data.noteId,
|
||||||
selectedOrActiveBranchIds: this.treeWidget.getSelectedOrActiveBranchIds(this.node),
|
selectedOrActiveBranchIds: this.treeWidget.getSelectedOrActiveBranchIds(this.node),
|
||||||
selectedOrActiveNoteIds: this.treeWidget.getSelectedOrActiveNoteIds(this.node)
|
selectedOrActiveNoteIds: this.treeWidget.getSelectedOrActiveNoteIds(this.node)
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user