From f16c7f270563cc79a7d7280d5a91ababc3be6965 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Wed, 27 May 2015 14:46:51 +0100 Subject: Simplify index calculation. --- background_scripts/main.coffee | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'background_scripts') diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index d4ba7850..a13d9d98 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -360,8 +360,7 @@ selectTab = (direction, count = 1) -> when "last" tabs.length - 1 # Bring toSelect into the range [0,tabs.length). - toSelect += tabs.length while toSelect < 0 - toSelect %= tabs.length + toSelect = (toSelect + tabs.length * Math.abs count) % tabs.length chrome.tabs.update tabs[toSelect].id, selected: true updateOpenTabs = (tab, deleteFrames = false) -> -- cgit v1.2.3