aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2017-10-10 21:50:00 +0900
committerGitHub <noreply@github.com>2017-10-10 21:50:00 +0900
commit01dfb156540bc21333490e07ad1e24be0f1eaeca (patch)
treeef4b0424198f0907b814187f6fd40d433efb4f23
parenta968a82f08cca388c27fb64608edb6b0190079d4 (diff)
parent053a6f094811f30b8bc24e05cb8bde3bdc8e8d06 (diff)
Merge pull request #44 from ueokande/fix-37
Fix tab selection
-rw-r--r--src/background/tabs.js4
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 });
});