diff options
author | Jan Holesovsky <kendy@collabora.com> | 2016-12-22 21:42:33 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2016-12-22 21:42:33 +0100 |
commit | 4736be43b377d0493ee0327f605a8551eca0d647 (patch) | |
tree | e858c3d1c21511b92b33e60b0f4c2e6bab7b454a /source/help.js | |
parent | bfe8593e120f83c936dc91fd40ece2e98c04603c (diff) |
help.js: Speedup the search.
Diffstat (limited to 'source/help.js')
-rw-r--r-- | source/help.js | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/source/help.js b/source/help.js index eac85ba7f1..6de81edd9f 100644 --- a/source/help.js +++ b/source/help.js @@ -127,18 +127,21 @@ function displayResult(file, moduleName, language, system) { var debouncer = null; $(document).ready(function() { - $('#search-bar').keyup(function() { - if(debouncer) { - clearTimeout(debouncer); - } - debouncer = setTimeout(function(){ - $("#BottomLeft ul li" ).show(); - if($('#search-bar').val()) { - $("#BottomLeft ul a:not(:contains('" + $('#search-bar').val() + "'))" ).parent().hide(); - } - }, 500); - }); - }); + $('#search-bar').keyup(function() { + if (debouncer) { + clearTimeout(debouncer); + } + debouncer = setTimeout(function(){ + if ($('#search-bar').val()) { + $("#BottomLeft ul a:not(:contains('" + $('#search-bar').val() + "'))" ).parent().hide(); + $("#BottomLeft ul a:contains('" + $('#search-bar').val() + "')" ).parent().show(); + } + else { + $("#BottomLeft ul li" ).show(); + } + }, 200); + }); +}); //http://papermashup.com/read-url-get-variables-withjavascript/ |