Skip to content
Open
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
4 changes: 3 additions & 1 deletion src/js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,4 +545,6 @@ function onRuntimeInstallNotification(details) {

browser.runtime.onInstalled.addListener(onRuntimeInstallNotification);


export async function switchToGroup(groupId, noTabSelected) {
await toggleVisibleTabs(groupId, noTabSelected);
}
22 changes: 19 additions & 3 deletions src/js/view/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { getGroupId } from './tabs.js';
import { tabMoved, groupDragOver, outsideDrop, createDragIndicator } from './drag.js';
import { groupNodes, initGroupNodes, closeGroup, makeGroupNode, fillGroupNodes, insertTab, resizeGroups, raiseGroup, updateGroupFit } from './groupNodes.js';
import { initTabNodes, makeTabNode, updateTabNode, setActiveTabNode, setActiveTabNodeById, getActiveTabId, deleteTabNode, updateThumbnail, updateFavicon } from './tabNodes.js';
import { switchToGroup } from '../background.js';
import * as groups from './groups.js';

var view = {
Expand All @@ -11,6 +12,7 @@ var view = {
dragIndicator: null,
//intervalId: null,
tabs: {},
loggedNumericKeys: ''
};

var pendingReload = false;
Expand Down Expand Up @@ -328,6 +330,8 @@ async function activateTiling() {
}

async function keyInput(e) {
var charList = '0123456789'; // we use a charlist as e.key is string not number

if (e.key === "ArrowRight") {
var activeTabId = getActiveTabId();
var groupId = await getGroupId(activeTabId);
Expand All @@ -340,7 +344,6 @@ async function keyInput(e) {
}
}


var newTabId = -1;
var max = childNodes.length - 2;
// check if at end or if tab not found
Expand Down Expand Up @@ -375,7 +378,6 @@ async function keyInput(e) {
}
}


var newTabId = -1;
var max = childNodes.length - 2;
// check if at end or if tab not found
Expand All @@ -399,8 +401,22 @@ async function keyInput(e) {
}

setActiveTabNodeById(newTabId);
} else if (charList.indexOf(e.key) > -1) {
// log numeric inputs
view.loggedNumericKeys += e.key;
e.stopPropagation();
} else if (e.key === "Enter") {
browser.tabs.update(getActiveTabId(), {active: true});
// if we have a keylogged groupID then raiseGroup
if (view.loggedNumericKeys != '') {
await switchToGroup(view.loggedNumericKeys, true);
} else {
// activate selected tab
browser.tabs.update(getActiveTabId(), {active: true});
}
view.loggedNumericKeys='';
} else {
// reset numkey logging
view.loggedNumericKeys = '';
}
}

Expand Down