[Libreoffice-commits] help.git: source/help.js
Jan Holesovsky
kendy at collabora.com
Thu Dec 22 20:44:01 UTC 2016
source/help.js | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
New commits:
commit 4736be43b377d0493ee0327f605a8551eca0d647
Author: Jan Holesovsky <kendy at collabora.com>
Date: Thu Dec 22 21:42:33 2016 +0100
help.js: Speedup the search.
diff --git a/source/help.js b/source/help.js
index eac85ba..6de81ed 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/
More information about the Libreoffice-commits
mailing list