mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 10:55:55 +01:00
refactored TabContext => NoteContext
This commit is contained in:
@@ -48,14 +48,14 @@ async function createNote(parentNotePath, options = {}) {
|
||||
await ws.waitForMaxKnownEntityChangeId();
|
||||
|
||||
if (options.activate) {
|
||||
const activeTabContext = appContext.tabManager.getActiveTabContext();
|
||||
await activeTabContext.setNote(`${parentNotePath}/${note.noteId}`);
|
||||
const activeNoteContext = appContext.tabManager.getActiveNoteContext();
|
||||
await activeNoteContext.setNote(`${parentNotePath}/${note.noteId}`);
|
||||
|
||||
if (options.focus === 'title') {
|
||||
appContext.triggerEvent('focusAndSelectTitle');
|
||||
}
|
||||
else if (options.focus === 'content') {
|
||||
appContext.triggerEvent('focusOnDetail', {tabId: activeTabContext.tabId});
|
||||
appContext.triggerEvent('focusOnDetail', {ntxId: activeNoteContext.ntxId});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,8 +90,8 @@ async function duplicateSubtree(noteId, parentNotePath) {
|
||||
|
||||
await ws.waitForMaxKnownEntityChangeId();
|
||||
|
||||
const activeTabContext = appContext.tabManager.getActiveTabContext();
|
||||
activeTabContext.setNote(`${parentNotePath}/${note.noteId}`);
|
||||
const activeNoteContext = appContext.tabManager.getActiveNoteContext();
|
||||
activeNoteContext.setNote(`${parentNotePath}/${note.noteId}`);
|
||||
|
||||
const origNote = await froca.getNote(noteId);
|
||||
toastService.showMessage(`Note "${origNote.title}" has been duplicated`);
|
||||
|
||||
Reference in New Issue
Block a user