diff options
| author | Bernardo B. Marques | 2011-12-16 01:44:42 -0200 |
|---|---|---|
| committer | Bernardo B. Marques | 2011-12-16 01:44:42 -0200 |
| commit | ca6f303b3d39f0e7bdeae6d239f124baefc4571b (patch) | |
| tree | 65ca80899c2c7cffaff446877c11f1afe67c3a4d /background_page.html | |
| parent | 6f9fd590561b26b01b6e2d3bac8617056af9d9be (diff) | |
| download | vimium-ca6f303b3d39f0e7bdeae6d239f124baefc4571b.tar.bz2 | |
add support to go to the first or last tab
Diffstat (limited to 'background_page.html')
| -rw-r--r-- | background_page.html | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/background_page.html b/background_page.html index b334f7b1..5866ee48 100644 --- a/background_page.html +++ b/background_page.html @@ -331,9 +331,11 @@ function nextTab(callback) { selectTab(callback, "next"); } function previousTab(callback) { selectTab(callback, "previous"); } + function firstTab(callback) { selectTab(callback, "first"); } + function lastTab(callback) { selectTab(callback, "last"); } /* - * Selects a tab before or after the currently selected tab. Direction is either "next" or "previous". + * Selects a tab before or after the currently selected tab. Direction is either "next", "previous", "first" or "last". */ function selectTab(callback, direction) { chrome.tabs.getAllInWindow(null, function(tabs) { @@ -347,6 +349,12 @@ case "previous": toSelect = tabs[(currentTab.index - 1 + tabs.length) % tabs.length]; break; + case "first": + toSelect = tabs[0]; + break; + case "last": + toSelect = tabs[tabs.length - 1]; + break; } selectionChangedHandlers.push(callback); chrome.tabs.update(toSelect.id, { selected: true }); |
