From c77b7824981d84bd908484b1eadaae13a0a8d03a Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Wed, 8 Oct 2008 18:57:25 +0000 Subject: [PATCH] Make autocompletion smoother --- content/util.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/util.js b/content/util.js index fae2dba1..900638c8 100644 --- a/content/util.js +++ b/content/util.js @@ -57,15 +57,15 @@ liberator.util = { //{{{ let now = Date.now(); if (this.doneAt == -1) timer.cancel(); - if (now >= this.doneAt || this.latest && now >= this.latest) - return this.notify(); let timeout = minInterval; - if (this.latest) + if (now > this.doneAt) + timeout = 0; + else if (this.latest) timeout = Math.min(minInterval, this.latest - now); else this.latest = now + maxInterval; - timer.initWithCallback(this, timeout, timer.TYPE_ONE_SHOT); + timer.initWithCallback(this, Math.max(timeout, 0), timer.TYPE_ONE_SHOT); this.doneAt = -1; } this.reset = function ()