diff options
| author | Phil Crosby | 2012-05-04 23:35:30 -0700 |
|---|---|---|
| committer | Phil Crosby | 2012-05-05 18:32:13 -0700 |
| commit | c65c9d1724a7b97f49a701512711df18e182bc79 (patch) | |
| tree | 6b9611dfcdcc8a0c250f9461a4292b718cd395f1 /lib | |
| parent | 15730576e5ef75cb1c01a867d7bd414572783604 (diff) | |
| download | vimium-c65c9d1724a7b97f49a701512711df18e182bc79.tar.bz2 | |
Shorten FuzzyTabCompletionSource
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/completion.js | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/lib/completion.js b/lib/completion.js index 103131dd..1f7aa2b8 100644 --- a/lib/completion.js +++ b/lib/completion.js @@ -158,23 +158,17 @@ var completion = (function() { }); /** A fuzzy tab completer */ - var FuzzyTabCompletionSource = function() { - AsyncCompletionSource.call(this); - } - utils.extend(AsyncCompletionSource, FuzzyTabCompletionSource); - - FuzzyTabCompletionSource.prototype.refresh = function() { - var self = this; - self.reset(); - - chrome.tabs.getAllInWindow(null, function(tabs) { - self.resultsReady(tabs.map(function(tab) { - return self.createInternalMatch('tab', tab, - { func: 'completion.createActionSwitchToTab', - args: [tab.id] }); - })); - }); - } + var FuzzyTabCompletionSource = AsyncCompletionSource.extend({ + refresh: function() { + this.reset(); + chrome.tabs.getAllInWindow(null, function(tabs) { + this.resultsReady(tabs.map(function(tab) { + return this.createInternalMatch("tab", tab, + { func: "completion.createActionSwitchToTab", args: [tab.id] }); + }.proxy(this))); + }.proxy(this)); + } + }); /* * A completer which matches only domains from sites in your history with the current query. |
