aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts/main.coffee
diff options
context:
space:
mode:
authorTimo Sand2013-02-16 22:09:27 +0000
committerTimo Sand2013-02-16 22:09:27 +0000
commitf7c3245778e21570fa4adb9d4f1f7a3723317383 (patch)
treec744a023e2721e2170c8230f6c7d1733c2192777 /background_scripts/main.coffee
parent6d931314a9cd20a3583da291f1466e3845c6b29f (diff)
downloadvimium-f7c3245778e21570fa4adb9d4f1f7a3723317383.tar.bz2
Finalized duplicateTab feature
Diffstat (limited to 'background_scripts/main.coffee')
-rw-r--r--background_scripts/main.coffee5
1 files changed, 4 insertions, 1 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index e6951102..03c2277a 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -218,7 +218,10 @@ repeatFunction = (func, totalCount, currentCount, frameId) ->
# mapped in commands.coffee.
BackgroundCommands =
createTab: (callback) -> chrome.tabs.create({ url: "chrome://newtab" }, (tab) -> callback())
- duplicateTab: (callback) -> chrome.tabs.duplicate(chrome.tabs.getCurrent(), (tab) -> callback())
+ duplicateTab: (callback) ->
+ chrome.tabs.getSelected(null, (tab) ->
+ chrome.tabs.duplicate(tab.id)
+ selectionChangedHandlers.push(callback))
nextTab: (callback) -> selectTab(callback, "next")
previousTab: (callback) -> selectTab(callback, "previous")
firstTab: (callback) -> selectTab(callback, "first")