aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts
diff options
context:
space:
mode:
authorStephen Blott2015-06-10 20:01:12 +0100
committerStephen Blott2015-06-10 20:01:12 +0100
commitabc24123a9bec8f07d019d31c08a8740e695401d (patch)
tree9597c4bcb595e00799d36b9a7ef8ee7d25d2759e /background_scripts
parent30cfcbdcfaecf03de67561ae88574fac837f75e3 (diff)
downloadvimium-abc24123a9bec8f07d019d31c08a8740e695401d.tar.bz2
Refactor moveTab for clarity...
... as suggested by @mrmr1993 in #1728.
Diffstat (limited to 'background_scripts')
-rw-r--r--background_scripts/main.coffee4
1 files changed, 1 insertions, 3 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index 272c3aa6..d4b14f3c 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -239,9 +239,7 @@ repeatFunction = (func, totalCount, currentCount, frameId) ->
moveTab = (count) ->
chrome.tabs.getAllInWindow null, (tabs) ->
- pinnedCount = 0
- for tab in tabs
- pinnedCount += 1 if tab.pinned
+ pinnedCount = (tabs.filter (tab) -> tab.pinned).length
chrome.tabs.getSelected null, (tab) ->
chrome.tabs.move tab.id,
index: Math.max pinnedCount, Math.min tabs.length - 1, tab.index + count