From c65c9d1724a7b97f49a701512711df18e182bc79 Mon Sep 17 00:00:00 2001 From: Phil Crosby Date: Fri, 4 May 2012 23:35:30 -0700 Subject: Shorten FuzzyTabCompletionSource --- lib/completion.js | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) (limited to 'lib') 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. -- cgit v1.2.3