From 5bde38eda9e855a7ef673f3e57d07826d4d00ffe Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Mon, 24 Nov 2014 05:50:08 +0000 Subject: Frames; eliminate Array::rotate. Array::rotate extends the array object, polluting its name space; so, instead, we just rotate the array manually. --- background_scripts/main.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'background_scripts') diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 10e6121f..48b54492 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -286,8 +286,9 @@ BackgroundCommands = chrome.tabs.getSelected(null, (tab) -> # 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. - offset = Math.max 0, frameIdsForTab[tab.id].indexOf frameId - frames = frameIdsForTab[tab.id] = frameIdsForTab[tab.id].rotate(count+offset) + count += Math.max 0, frameIdsForTab[tab.id].indexOf frameId + frames = frameIdsForTab[tab.id] + frames = frameIdsForTab[tab.id] = [frames[count..]..., frames[0...count]...] chrome.tabs.sendMessage(tab.id, { name: "focusFrame", frameId: frames[0], highlight: true })) closeTabsOnLeft: -> removeTabsRelative "before" -- cgit v1.2.3