diff options
| author | int3 | 2010-04-17 07:08:14 +0800 |
|---|---|---|
| committer | Ilya | 2010-04-17 01:34:35 +0800 |
| commit | 72f070597e164c60e9811ae13088335c91dec9f4 (patch) | |
| tree | 45a0666fe3334845399eda2efddd7ad820e2044f /background_page.html | |
| parent | 70f2a92dcb9b0799db49305d4a47c0a104968847 (diff) | |
| download | vimium-72f070597e164c60e9811ae13088335c91dec9f4.tar.bz2 | |
Undo 'Keep tab queue indices updated when a tab is detached'.
It does not follow Chrome's native behavior (and was buggy anyway.)
Diffstat (limited to 'background_page.html')
| -rw-r--r-- | background_page.html | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/background_page.html b/background_page.html index 0c8b2d20..4c328a20 100644 --- a/background_page.html +++ b/background_page.html @@ -327,7 +327,6 @@ // We should update all the tabs in the old window and the new window. if (openTabs[tabId]) { updatePositionsAndWindowsForAllTabsInWindow(openTabs[tabId].windowId); - updateTabQueueIndices(openTabs[tabId].windowId, openTabs[tabId].positionIndex); } updatePositionsAndWindowsForAllTabsInWindow(attachedInfo.newWindowId); }); @@ -336,14 +335,6 @@ updatePositionsAndWindowsForAllTabsInWindow(moveInfo.windowId); }); - function updateTabQueueIndices(windowId, positionIndex) { - for (var i in tabQueue[windowId]) { - if (tabQueue[windowId][i].positionIndex > positionIndex) { - tabQueue[windowId][i].positionIndex--; - } - } - } - chrome.tabs.onRemoved.addListener(function(tabId) { var openTabInfo = openTabs[tabId]; updatePositionsAndWindowsForAllTabsInWindow(openTabInfo.windowId); @@ -352,7 +343,10 @@ // Pretend they never existed and adjust tab indices accordingly. // Could possibly expand this into a blacklist in the future if (/^chrome[^:]*:\/\/.*/.test(openTabInfo.url)) { - updateTabQueueIndices(openTabInfo.windowId, openTabInfo.positionIndex); + for (var i in tabQueue[openTabInfo.windowId]) { + if (tabQueue[openTabInfo.windowId][i].positionIndex > openTabInfo.positionIndex) + tabQueue[openTabInfo.windowId][i].positionIndex--; + } return; } |
