Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(focus): Add more shortcuts to focus the child/sibling #2237

Merged
merged 1 commit into from
Apr 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions webextensions/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
"command_focusNextSilently": { "message": "Focus to Next Tab (don't expand tree)" },
"command_focusParent": { "message": "Focus to Parent Tab" },
"command_focusFirstChild": { "message": "Focus to First Child Tab" },
"command_focusLastChild": { "message": "Focus to Last Child Tab" },
"command_focusPreviousSibling": { "message": "Focus to Previous Sibling Tab" },
"command_focusNextSibling": { "message": "Focus to Next Sibling Tab" },
"command_tabbarUp": { "message": "Scroll Tabs Up by Line" },
"command_tabbarPageUp": { "message": "Scroll Tabs Up by Page" },
"command_tabbarHome": { "message": "Scroll Tabs to Top" },
Expand Down
14 changes: 14 additions & 0 deletions webextensions/background/handle-misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,20 @@ async function onShortcutCommand(command) {
case 'focusFirstChild':
TabsInternalOperation.activateTab(activeTab.$TST.firstChild);
return;
case 'focusLastChild':
const children = activeTab.$TST.children;
if(children.length > 0) {
TabsInternalOperation.activateTab(children[children.length - 1]);
}
return;
case 'focusPreviousSibling': {
TabsInternalOperation.activateTab(activeTab.$TST.previousSiblingTab);
return;
}
case 'focusNextSibling': {
TabsInternalOperation.activateTab(activeTab.$TST.nextSiblingTab);
return;
}

case 'tabbarUp':
SidebarConnection.sendMessage({
Expand Down
9 changes: 9 additions & 0 deletions webextensions/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,15 @@
"focusFirstChild": {
"description": "__MSG_command_focusFirstChild__"
},
"focusLastChild": {
"description": "__MSG_command_focusLastChild__"
},
"focusPreviousSibling": {
"description": "__MSG_command_focusPreviousSibling__"
},
"focusNextSibling": {
"description": "__MSG_command_focusNextSibling__"
},
"tabbarUp": {
"description": "__MSG_command_tabbarUp__ (Alt+Shift+Up)"
},
Expand Down