From 9963b7193529f5e656da1130504057145042cdc5 Mon Sep 17 00:00:00 2001 From: Grant Bakker Date: Tue, 25 Aug 2020 14:10:12 +0000 Subject: [PATCH] Re-add toggle-panorama-view --- src/js/background.js | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/js/background.js b/src/js/background.js index 39dc9b5..b4ae8d8 100644 --- a/src/js/background.js +++ b/src/js/background.js @@ -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 }); @@ -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) {