Skip to content

Build your personal knowledge base with Trilium Notes

ctrl+alt+p will create new note in a new tab

zadam597eb5a30000
diff --git a/src/public/javascripts/desktop.js b/src/public/javascripts/desktop.js
index 30df2dcd2e..f1ff1f57b4 100644
--- a/src/public/javascripts/desktop.js
+++ b/src/public/javascripts/desktop.js
@@ -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
diff --git a/src/public/javascripts/services/note_detail.js b/src/public/javascripts/services/note_detail.js
index 86ed3c3976..20eaa889c8 100644
--- a/src/public/javascripts/services/note_detail.js
+++ b/src/public/javascripts/services/note_detail.js
@@ -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
};
\ No newline at end of file
diff --git a/src/public/javascripts/services/tab_context.js b/src/public/javascripts/services/tab_context.js
index 9a40630a4f..7088a2c6d0 100644
--- a/src/public/javascripts/services/tab_context.js
+++ b/src/public/javascripts/services/tab_context.js
@@ -68,6 +68,7 @@ class TabContext {
const title = this.$noteTitle.val();
+ this.tabRow.updateTab(this.$tab[0], {title});
treeService.setNoteTitle(this.noteId, title);
});