diff options
| author | jez | 2011-02-01 11:27:13 +0800 |
|---|---|---|
| committer | jez | 2011-02-01 11:27:13 +0800 |
| commit | 4eb1d8ebcdae0816c8826792110564927124d5d6 (patch) | |
| tree | b4d3e4d5944fc0852b7ef59ab8b911452d150450 /completionDialog.js | |
| parent | 1133f348558e8e70aa5e76ca67a739a5303467bd (diff) | |
| download | vimium-4eb1d8ebcdae0816c8826792110564927124d5d6.tar.bz2 | |
Cosmetics (semicolons)
Diffstat (limited to 'completionDialog.js')
| -rw-r--r-- | completionDialog.js | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/completionDialog.js b/completionDialog.js index fbe83ec0..1b2d3646 100644 --- a/completionDialog.js +++ b/completionDialog.js @@ -1,7 +1,7 @@ (function(window, document) { var CompletionDialog = function(options) { - this.options = options + this.options = options; } CompletionDialog.prototype = { @@ -14,7 +14,7 @@ this.initialized=true; } handlerStack.push({ keydown: this.onKeydown }); - render.call(this) + render.call(this); clearInterval(this._tweenId); this._tweenId = Tween.fade(this.container, 1.0, 150); } @@ -30,18 +30,18 @@ }, getDisplayElement: function() { if(!this.container) { - this.container = createDivInside(document.body) + this.container = createDivInside(document.body); } - return this.container + return this.container; }, getQueryString: function() { - return this.query.join("") + return this.query.join(""); } } var initialize = function() { - var self = this - addCssToPage(completionCSS) + var self = this; + addCssToPage(completionCSS); self.currentSelection=0; @@ -51,29 +51,29 @@ if(self.currentSelection>0) { self.currentSelection-=1; } - render.call(self,self.getQueryString(), self.completions) + render.call(self,self.getQueryString(), self.completions); } else if(keyChar==="down") { if(self.currentSelection<self.completions.length-1) { self.currentSelection+=1; } - render.call(self,self.getQueryString(), self.completions) + render.call(self,self.getQueryString(), self.completions); } else if(event.keyCode == keyCodes.enter) { - self.options.onSelect(self.completions[self.currentSelection]) + self.options.onSelect(self.completions[self.currentSelection]); } else if (event.keyCode == keyCodes.backspace || event.keyCode == keyCodes.deleteKey) { if (self.query.length > 0) { self.query.pop(); self.options.source(self.getQueryString(), function(completions) { - render.call(self, self.getQueryString(), completions) + render.call(self, self.getQueryString(), completions); }) } } else if(keyChar!=="left" && keyChar!="right") { self.query.push(keyChar); self.options.source(self.getQueryString(), function(completions) { - render.call(self, self.getQueryString(), completions) + render.call(self, self.getQueryString(), completions); }) } @@ -87,33 +87,33 @@ if(this.isShown) { this.searchString = searchString; this.completions = completions; - var container = this.getDisplayElement() + var container = this.getDisplayElement(); clearChildren(container); if(searchString===undefined) { this.container.className = "vimium-dialog"; - createDivInside(container).innerHTML=this.options.initialSearchText || "Begin typing" + createDivInside(container).innerHTML=this.options.initialSearchText || "Begin typing"; } else { this.container.className = "vimium-dialog vimium-completions"; - var searchBar = createDivInside(container) - searchBar.innerHTML=searchString - searchBar.className="vimium-searchBar" + var searchBar = createDivInside(container); + searchBar.innerHTML=searchString; + searchBar.className="vimium-searchBar"; - searchResults = createDivInside(container) - searchResults.className="vimium-searchResults" + searchResults = createDivInside(container); + searchResults.className="vimium-searchResults"; if(completions.length<=0) { - var resultDiv = createDivInside(searchResults) - resultDiv.className="vimium-noResults" - resultDiv.innerHTML="No results found" + var resultDiv = createDivInside(searchResults); + resultDiv.className="vimium-noResults"; + resultDiv.innerHTML="No results found"; } else { for(var i=0;i<completions.length;i++) { - var resultDiv = createDivInside(searchResults) + var resultDiv = createDivInside(searchResults); if(i===this.currentSelection) { - resultDiv.className="vimium-selected" + resultDiv.className="vimium-selected"; } - resultDiv.innerHTML=this.options.renderOption(searchString, completions[i]) + resultDiv.innerHTML=this.options.renderOption(searchString, completions[i]); } } } @@ -125,7 +125,7 @@ var createDivInside = function(parent) { var element = document.createElement("div"); parent.appendChild(element); - return element + return element; } var clearChildren = function(elem) { |
