1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 21:22:26 +01:00

Make autocompletion smoother

This commit is contained in:
Kris Maglione
2008-10-08 18:57:25 +00:00
parent 605cf4bbc3
commit c77b782498

View File

@@ -57,15 +57,15 @@ liberator.util = { //{{{
let now = Date.now(); let now = Date.now();
if (this.doneAt == -1) if (this.doneAt == -1)
timer.cancel(); timer.cancel();
if (now >= this.doneAt || this.latest && now >= this.latest)
return this.notify();
let timeout = minInterval; let timeout = minInterval;
if (this.latest) if (now > this.doneAt)
timeout = 0;
else if (this.latest)
timeout = Math.min(minInterval, this.latest - now); timeout = Math.min(minInterval, this.latest - now);
else else
this.latest = now + maxInterval; 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.doneAt = -1;
} }
this.reset = function () this.reset = function ()