From 3a0f19dc531c2a5fafc02f1e4f97cab5517c93bf Mon Sep 17 00:00:00 2001 From: Phil Crosby Date: Sat, 5 May 2012 00:09:14 -0700 Subject: less inheritence --- lib/completion.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'lib/completion.js') diff --git a/lib/completion.js b/lib/completion.js index bc9b6fc6..240468cb 100644 --- a/lib/completion.js +++ b/lib/completion.js @@ -165,12 +165,16 @@ var completion = (function() { }); /** A fuzzy tab completer */ - var FuzzyTabCompletionSource = AsyncCompletionSource.extend({ + var FuzzyTabCompletionSource = Class.extend({ + init: function() { this.asyncCompleter = new AsyncCompletionSource(); }, + + filter: function(query, callback) { return this.asyncCompleter.filter(query, callback); }, + refresh: function() { - this.reset(); + this.asyncCompleter.reset(); chrome.tabs.getAllInWindow(null, function(tabs) { - this.resultsReady(tabs.map(function(tab) { - return this.createInternalMatch("tab", tab, + this.asyncCompleter.resultsReady(tabs.map(function(tab) { + return this.asyncCompleter.createInternalMatch("tab", tab, { func: "completion.createActionSwitchToTab", args: [tab.id] }); }.proxy(this))); }.proxy(this)); -- cgit v1.2.3