From 9fd6faa0d5d0b9cda83e9595054c66822c2cbd72 Mon Sep 17 00:00:00 2001 From: Niklas Baumstark Date: Tue, 24 Jan 2012 23:33:07 +0100 Subject: hide completion list if no completions are available --- fuzzyMode.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fuzzyMode.js b/fuzzyMode.js index 9e3b09e0..c3b20096 100644 --- a/fuzzyMode.js +++ b/fuzzyMode.js @@ -152,7 +152,6 @@ var fuzzyMode = (function() { this.completionList.style.display = 'none'; return; } - this.completionList.style.display = 'block'; var self = this; this.completer.filter(this.query, function(completions) { @@ -167,6 +166,8 @@ var fuzzyMode = (function() { li.innerHTML = completions[i].render(); self.completionList.appendChild(li); } + + self.completionList.style.display = completions.length > 0 ? 'block' : 'none'; self.updateSelection(); }); }, -- cgit v1.2.3