diff options
Diffstat (limited to 'lib/completion.js')
| -rw-r--r-- | lib/completion.js | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/completion.js b/lib/completion.js index e8365b9c..7e4bcf57 100644 --- a/lib/completion.js +++ b/lib/completion.js @@ -2,14 +2,15 @@ var completion = (function() { /** Helper class to construct fuzzy completers for asynchronous data sources like history or bookmark * matchers. */ - var AsyncCompletionSource = function() { - this.id = utils.createUniqueId(); - this.reset(); - this.resultsReady = this.fallbackReadyCallback = function(results) { - this.completions = results; - } - } - AsyncCompletionSource.prototype = { + var AsyncCompletionSource = Class.extend({ + init: function() { + this.id = utils.createUniqueId(); + this.reset(); + this.resultsReady = this.fallbackReadyCallback = function(results) { + this.completions = results; + } + }, + reset: function() { fuzzyMatcher.invalidateFilterCache(this.id); this.completions = null; @@ -64,8 +65,8 @@ var completion = (function() { self.resultsReady(results); } } - }, - } + } + }); /** A simple completer that suggests to open the input string as an URL or to trigger a web search for the * given term, depending on whether it thinks the input is a URL or not. */ |
