diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-10-10 21:24:57 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-10-10 21:45:54 +0900 |
commit | 053a6f094811f30b8bc24e05cb8bde3bdc8e8d06 (patch) | |
tree | ef4b0424198f0907b814187f6fd40d433efb4f23 /src | |
parent | a968a82f08cca388c27fb64608edb6b0190079d4 (diff) |
fix tab selection
Diffstat (limited to 'src')
-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 }); }); |