reimplement note source to open in a new tab

This commit is contained in:
zadam
2023-02-14 16:06:49 +01:00
parent c190296bf9
commit b1e2b5ba8e
11 changed files with 82 additions and 127 deletions

View File

@@ -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' });
}
}
}