mirror of
https://github.com/zadam/trilium.git
synced 2025-10-30 01:36:24 +01:00
reimplement note source to open in a new tab
This commit is contained in:
@@ -18,7 +18,7 @@ export default class RootCommandExecutor extends Component {
|
||||
async showSQLConsoleCommand() {
|
||||
const sqlConsoleNote = await dateNoteService.createSqlConsole();
|
||||
|
||||
const noteContext = await appContext.tabManager.openContextWithNote(sqlConsoleNote.noteId, true);
|
||||
const noteContext = await appContext.tabManager.openContextWithNote(sqlConsoleNote.noteId, { activate: true });
|
||||
|
||||
appContext.triggerEvent('focusOnDetail', {ntxId: noteContext.ntxId});
|
||||
}
|
||||
@@ -32,7 +32,10 @@ export default class RootCommandExecutor extends Component {
|
||||
const activeNoteContext = appContext.tabManager.getActiveContext();
|
||||
const hoistedNoteId = activeNoteContext?.hoistedNoteId || 'root';
|
||||
|
||||
const noteContext = await appContext.tabManager.openContextWithNote(searchNote.noteId, true, null, hoistedNoteId);
|
||||
const noteContext = await appContext.tabManager.openContextWithNote(searchNote.noteId, {
|
||||
activate: true,
|
||||
hoistedNoteId
|
||||
});
|
||||
|
||||
appContext.triggerCommand('focusOnSearchDefinition', {ntxId: noteContext.ntxId});
|
||||
}
|
||||
@@ -73,7 +76,7 @@ export default class RootCommandExecutor extends Component {
|
||||
}
|
||||
|
||||
async showBackendLogCommand() {
|
||||
await appContext.tabManager.openContextWithNote('_backendLog', true);
|
||||
await appContext.tabManager.openContextWithNote('_backendLog', { activate: true });
|
||||
}
|
||||
|
||||
async showLaunchBarSubtreeCommand() {
|
||||
@@ -89,11 +92,10 @@ export default class RootCommandExecutor extends Component {
|
||||
}
|
||||
|
||||
async showOptionsCommand({section}) {
|
||||
await appContext.tabManager.openContextWithNote(
|
||||
section || '_options',
|
||||
true,
|
||||
null,
|
||||
'_options');
|
||||
await appContext.tabManager.openContextWithNote(section || '_options', {
|
||||
activate: true,
|
||||
hoistedNoteId: '_options'
|
||||
});
|
||||
}
|
||||
|
||||
async showSQLConsoleHistoryCommand() {
|
||||
@@ -109,6 +111,17 @@ export default class RootCommandExecutor extends Component {
|
||||
}
|
||||
|
||||
async showAndHoistSubtree(subtreeNoteId) {
|
||||
await appContext.tabManager.openContextWithNote(subtreeNoteId, true, null, subtreeNoteId);
|
||||
await appContext.tabManager.openContextWithNote(subtreeNoteId, {
|
||||
activate: true,
|
||||
hoistedNoteId: subtreeNoteId
|
||||
});
|
||||
}
|
||||
|
||||
async showNoteSourceEvent() {
|
||||
const notePath = appContext.tabManager.getActiveContextNotePath();
|
||||
|
||||
if (notePath) {
|
||||
await appContext.tabManager.openContextWithNote(notePath, { activate: true, viewMode: 'source' });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user