Skip to content
Open
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
30 changes: 16 additions & 14 deletions src/js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,20 +217,6 @@ async function changeActiveGroupBy(offset) {
await toggleVisibleTabs(activeGroup, true);
}

async function triggerCommand(command) {
const options = await loadOptions();

if (options.shortcut[command].disabled) {
// Doesn't execute disabled command
return;
}
if (command === 'activate-next-group') {
await changeActiveGroupBy(1);
} else if (command === 'activate-previous-group') {
await changeActiveGroupBy(-1);
}
}

/** Open the Panorama View tab, or return to the last open tab if Panorama View is currently open */
async function toggleView() {
const extTabs = await browser.tabs.query({ url: browser.extension.getURL('view.html'), currentWindow: true });
Expand All @@ -256,6 +242,22 @@ async function toggleView() {
}
}

async function triggerCommand(command) {
const options = await loadOptions();

if (options.shortcut[command].disabled) {
// Doesn't execute disabled command
return;
}
if (command === 'activate-next-group') {
await changeActiveGroupBy(1);
} else if (command === 'activate-previous-group') {
await changeActiveGroupBy(-1);
} else if (command === 'toggle-panorama-view') {
await toggleView();
}
}

/** Callback function which will be called whenever a tab is opened */
async function tabCreated(tab) {
if (window.backgroundState.openingBackup) {
Expand Down