aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Crosby2013-05-09 10:53:04 -0700
committerPhil Crosby2013-05-09 10:53:04 -0700
commit5bd32a511da813d731f73c4d646c14a69c2515ff (patch)
tree1195e9df592e367b9d0a9332600c6b4b507fe738
parent4820008d292cb141aa9966e691f60dedf8616219 (diff)
parente678622b8ce2113431598177e148e8a32dfc0e77 (diff)
downloadvimium-5bd32a511da813d731f73c4d646c14a69c2515ff.tar.bz2
Merge pull request #830 from sainaen/removeTab_callback_fix
removeTab() shouldn't add callback to selectionChangedHandlers if it's undefined
-rw-r--r--background_scripts/main.coffee7
1 files changed, 2 insertions, 5 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index 71f963b2..c585c265 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -234,12 +234,9 @@ BackgroundCommands =
previousTab: (callback) -> selectTab(callback, "previous")
firstTab: (callback) -> selectTab(callback, "first")
lastTab: (callback) -> selectTab(callback, "last")
- removeTab: (callback) ->
+ removeTab: ->
chrome.tabs.getSelected(null, (tab) ->
- chrome.tabs.remove(tab.id)
- # We can't just call the callback here because we need to wait
- # for the selection to change to consider this action done.
- selectionChangedHandlers.push(callback))
+ chrome.tabs.remove(tab.id))
restoreTab: (callback) ->
# TODO(ilya): Should this be getLastFocused instead?
chrome.windows.getCurrent((window) ->