mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
change default action of clicking note to open in new tab
This commit is contained in:
parent
0896000fcd
commit
81ca4f3309
@ -293,6 +293,15 @@ export default class TabManager extends Component {
|
|||||||
const hoistedNoteId = opts.hoistedNoteId || 'root';
|
const hoistedNoteId = opts.hoistedNoteId || 'root';
|
||||||
const viewMode = opts.viewMode || "default";
|
const viewMode = opts.viewMode || "default";
|
||||||
|
|
||||||
|
const targetNoteId = await treeService.getNoteIdFromNotePath(notePath);
|
||||||
|
for (const openedNoteContext of this.getNoteContexts()) {
|
||||||
|
if (openedNoteContext.note && openedNoteContext.note.noteId === targetNoteId) {
|
||||||
|
this.activateNoteContext(openedNoteContext.ntxId, true);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const noteContext = await this.openEmptyTab(ntxId, hoistedNoteId, mainNtxId);
|
const noteContext = await this.openEmptyTab(ntxId, hoistedNoteId, mainNtxId);
|
||||||
|
|
||||||
if (notePath) {
|
if (notePath) {
|
||||||
|
@ -363,7 +363,13 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
|
|||||||
this.tree.reactivate(true);
|
this.tree.reactivate(true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
node.setActive();
|
const noteId = node.data.noteId;
|
||||||
|
const notePath = treeService.getNotePath(node);
|
||||||
|
if (noteId.startsWith('_')) {
|
||||||
|
node.setActive();
|
||||||
|
} else {
|
||||||
|
appContext.tabManager.openTabWithNoteWithHoisting(notePath, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user