diff options
Diffstat (limited to 'background_scripts/main.coffee')
| -rw-r--r-- | background_scripts/main.coffee | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 48b54492..3ec618c9 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -284,10 +284,10 @@ BackgroundCommands = moveTabRight: (count) -> moveTab(null, count) nextFrame: (count,frameId) -> chrome.tabs.getSelected(null, (tab) -> + frames = frameIdsForTab[tab.id] # We can't always track which frame chrome has focussed, but here we learn that it's frameId; so add an # additional offset such that we do indeed start from frameId. - count += Math.max 0, frameIdsForTab[tab.id].indexOf frameId - frames = frameIdsForTab[tab.id] + count = (count + Math.max 0, frameIdsForTab[tab.id].indexOf frameId) % frames.length frames = frameIdsForTab[tab.id] = [frames[count..]..., frames[0...count]...] chrome.tabs.sendMessage(tab.id, { name: "focusFrame", frameId: frames[0], highlight: true })) |
