From 30cfcbdcfaecf03de67561ae88574fac837f75e3 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Wed, 10 Jun 2015 19:21:41 +0100 Subject: Do not try to move a tab to the left of pinned tabs. --- background_scripts/main.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'background_scripts') diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 6e1226b6..272c3aa6 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -239,9 +239,12 @@ repeatFunction = (func, totalCount, currentCount, frameId) -> moveTab = (count) -> chrome.tabs.getAllInWindow null, (tabs) -> + pinnedCount = 0 + for tab in tabs + pinnedCount += 1 if tab.pinned chrome.tabs.getSelected null, (tab) -> chrome.tabs.move tab.id, - index: Math.max 0, Math.min tabs.length - 1, tab.index + count + index: Math.max pinnedCount, Math.min tabs.length - 1, tab.index + count # Start action functions -- cgit v1.2.3