diff options
| author | Stephen Blott | 2015-05-05 14:27:41 +0100 |
|---|---|---|
| committer | Stephen Blott | 2015-05-05 14:27:41 +0100 |
| commit | e21896e2af7f28eb17b5b98a32cfce32fe171d3a (patch) | |
| tree | ade70fccb2442ea13bff8a7b160c638c19b370d5 | |
| parent | 1a9ea85f683c892592d7092c361e835c8b0f4f3e (diff) | |
| download | vimium-e21896e2af7f28eb17b5b98a32cfce32fe171d3a.tar.bz2 | |
Search completion; rework asynchronous lookups.
| -rw-r--r-- | pages/vomnibar.coffee | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/pages/vomnibar.coffee b/pages/vomnibar.coffee index ff004c6e..58513dc2 100644 --- a/pages/vomnibar.coffee +++ b/pages/vomnibar.coffee @@ -186,14 +186,13 @@ class VomnibarUI @update() update: (updateSynchronously = false, callback = null) => - # Cancel any scheduled update. - if @updateTimer? - window.clearTimeout @updateTimer - @updateTimer = null - if updateSynchronously + # Cancel any scheduled update. + if @updateTimer? + window.clearTimeout @updateTimer + @updateTimer = null @updateCompletions callback - else + else if not @updateTimer? # Update asynchronously for better user experience and to take some load off the CPU (not every # keystroke will cause a dedicated update) @updateTimer = Utils.setTimeout @refreshInterval, => |
