ctrl+tab and ctrl+shift+tab can be used to switch tabs

This commit is contained in:
zadam
2019-05-07 21:04:07 +02:00
parent d36bff2a97
commit aef0e552a0
4 changed files with 78 additions and 38 deletions

View File

@@ -47,6 +47,7 @@ async function reloadAllTabs() {
const note = await loadNote(noteContext.note.noteId);
await loadNoteDetailToContext(noteContext, note);
}
}
@@ -271,6 +272,22 @@ if (utils.isElectron()) {
chromeTabs.removeTab(chromeTabs.activeTabEl);
});
utils.bindShortcut('ctrl+tab', () => {
const nextTab = chromeTabs.nextTabEl;
if (nextTab) {
chromeTabs.setCurrentTab(nextTab);
}
});
utils.bindShortcut('ctrl+shift+tab', () => {
const prevTab = chromeTabs.previousTabEl;
if (prevTab) {
chromeTabs.setCurrentTab(prevTab);
}
});
}
// this makes sure that when user e.g. reloads the page or navigates away from the page, the note's content is saved