mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
ctrl+alt+p will create new note in a new tab
This commit is contained in:
parent
f3e7e6bbe7
commit
597eb5a300
@ -120,6 +120,8 @@ if (utils.isElectron()) {
|
||||
const todayNote = await dateNoteService.getTodayNote();
|
||||
const node = await treeService.expandToNote(todayNote.noteId);
|
||||
|
||||
await noteDetailService.openEmptyTab(false);
|
||||
|
||||
await treeService.createNote(node, todayNote.noteId, 'into', {
|
||||
type: "text",
|
||||
isProtected: node.data.isProtected
|
||||
|
@ -335,11 +335,13 @@ $tabContentsContainer.on("drop", e => {
|
||||
});
|
||||
});
|
||||
|
||||
async function openEmptyTab() {
|
||||
async function openEmptyTab(render = true) {
|
||||
const ctx = new TabContext(tabRow);
|
||||
tabContexts.push(ctx);
|
||||
|
||||
await renderComponent(ctx);
|
||||
if (render) {
|
||||
await renderComponent(ctx);
|
||||
}
|
||||
|
||||
await tabRow.activateTab(ctx.$tab[0]);
|
||||
}
|
||||
@ -493,5 +495,6 @@ export default {
|
||||
isActive,
|
||||
activateTabContext,
|
||||
clearOpenTabsTask,
|
||||
filterTabs
|
||||
filterTabs,
|
||||
openEmptyTab
|
||||
};
|
@ -68,6 +68,7 @@ class TabContext {
|
||||
|
||||
const title = this.$noteTitle.val();
|
||||
|
||||
this.tabRow.updateTab(this.$tab[0], {title});
|
||||
treeService.setNoteTitle(this.noteId, title);
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user