From 6463714d0f477b35d3d8f533eafbe980ada0bf05 Mon Sep 17 00:00:00 2001 From: Niklas Baumstark Date: Tue, 24 Jan 2012 23:28:33 +0100 Subject: fix small bug when closing and reopening dialog in combination with async updating --- fuzzyMode.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fuzzyMode.js b/fuzzyMode.js index 7716acfa..9e3b09e0 100644 --- a/fuzzyMode.js +++ b/fuzzyMode.js @@ -48,8 +48,6 @@ var fuzzyMode = (function() { this.prompt = '> '; this.maxResults = maxResults; this.refreshInterval = refreshInterval; - // query used to filter the last completion result. We need this for asynchronous updating - this.lastQuery = ''; this.initDom(); this.reset(); } @@ -73,6 +71,8 @@ var fuzzyMode = (function() { reset: function() { this.query = ''; + // query used to filter the last completion result. We need this for asynchronous updating + this.lastQuery = null; this.completions = []; this.selection = 0; // force synchronous updating so that the old results will not be flash up shortly @@ -182,7 +182,7 @@ var fuzzyMode = (function() { // always update asynchronously for better user experience and to take some load off the CPU // (not every keystroke will cause a dedicated update) setTimeout(function() { - if (self.query == self.lastQuery) + if (self.query === self.lastQuery) return; self.lastQuery = self.query; self.updateCompletions(); -- cgit v1.2.3