aboutsummaryrefslogtreecommitdiffstats
path: root/fuzzyMode.js
diff options
context:
space:
mode:
authorPhil Crosby2012-05-05 18:49:41 -0700
committerPhil Crosby2012-05-05 18:49:41 -0700
commit15a5319948ec0f27b83cdbb906db879e5f6689d5 (patch)
treef4a1a6d35ffae1de9e83036711987bef62091856 /fuzzyMode.js
parent46f395b18705231af14a76b8050ce168a4640dda (diff)
downloadvimium-15a5319948ec0f27b83cdbb906db879e5f6689d5.tar.bz2
Use class.extend for fuzzybox
Diffstat (limited to 'fuzzyMode.js')
-rw-r--r--fuzzyMode.js23
1 files changed, 11 insertions, 12 deletions
diff --git a/fuzzyMode.js b/fuzzyMode.js
index 3b4839e8..9d4f32e8 100644
--- a/fuzzyMode.js
+++ b/fuzzyMode.js
@@ -20,21 +20,20 @@ var fuzzyMode = (function() {
}
/** User interface for fuzzy completion */
- var FuzzyBox = function(maxResults) {
- this.prompt = '>';
- this.maxResults = maxResults;
- this.refreshInterval = 0;
- this.initDom();
- }
- FuzzyBox.prototype = {
+ var FuzzyBox = Class.extend({
+ init: function(maxResults) {
+ this.prompt = '>';
+ this.maxResults = maxResults;
+ this.refreshInterval = 0;
+ this.initDom();
+ },
+
setCompleter: function(completer) {
this.completer = completer;
this.reset();
},
- setRefreshInterval: function(refreshInterval) {
- this.refreshInterval = refreshInterval;
- },
+ setRefreshInterval: function(refreshInterval) { this.refreshInterval = refreshInterval; },
show: function() {
this.box.style.display = "block";
@@ -160,8 +159,8 @@ var fuzzyMode = (function() {
this.input.addEventListener("input", function() { this.update(); }.bind(this));
this.completionList = document.querySelector("#fuzzybox ul");
this.completionList.style.display = "none";
- },
- }
+ }
+ });
/*
* Sends filter and refresh requests to a Vomnibox completer on the background page.