diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-10-10 21:50:00 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-10 21:50:00 +0900 |
commit | 01dfb156540bc21333490e07ad1e24be0f1eaeca (patch) | |
tree | ef4b0424198f0907b814187f6fd40d433efb4f23 | |
parent | a968a82f08cca388c27fb64608edb6b0190079d4 (diff) | |
parent | 053a6f094811f30b8bc24e05cb8bde3bdc8e8d06 (diff) |
Merge pull request #44 from ueokande/fix-37
Fix tab selection
-rw-r--r-- | src/background/tabs.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/background/tabs.js b/src/background/tabs.js index 32f71ba..166af4d 100644 --- a/src/background/tabs.js +++ b/src/background/tabs.js @@ -62,7 +62,7 @@ const selectPrevTab = (current, count) => { if (tabs.length < 2) { return; } - let select = (current - count) % tabs.length; + let select = (current - count + tabs.length) % tabs.length; let id = tabs[select].id; return browser.tabs.update(id, { active: true }); }); @@ -73,7 +73,7 @@ const selectNextTab = (current, count) => { if (tabs.length < 2) { return; } - let select = (current + count + tabs.length) % tabs.length; + let select = (current + count) % tabs.length; let id = tabs[select].id; return browser.tabs.update(id, { active: true }); }); |