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

This commit is contained in:
zadam 2019-05-19 10:46:19 +02:00
parent f3e7e6bbe7
commit 597eb5a300
3 changed files with 9 additions and 3 deletions

View File

@ -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

View File

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

View File

@ -68,6 +68,7 @@ class TabContext {
const title = this.$noteTitle.val();
this.tabRow.updateTab(this.$tab[0], {title});
treeService.setNoteTitle(this.noteId, title);
});