diff options
author | gabrielchiquini <gabrielchiquini@hotmail.com> | 2017-09-30 23:48:29 -0300 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@libreoffice.org> | 2017-10-03 12:49:41 +0200 |
commit | 507d26615775cc233413cbb140dd3e7ccf971567 (patch) | |
tree | 018bede02be9e4a52ac452c7c73dcdbb8c35469b /help3xsl/help.js | |
parent | aa1e7fffd4f067414833d593cd0307bd2dc9d6f9 (diff) |
tdf#112370 Add case-insensitive support to index search
Change-Id: I460f853f4abd6bf8124f2b6d01d5b771fcc6569c
Reviewed-on: https://gerrit.libreoffice.org/42984
Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Tested-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Diffstat (limited to 'help3xsl/help.js')
-rw-r--r-- | help3xsl/help.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/help3xsl/help.js b/help3xsl/help.js index e576cb54b5..ba7a4523b4 100644 --- a/help3xsl/help.js +++ b/help3xsl/help.js @@ -98,8 +98,11 @@ $(document).ready(function() { } debouncer = setTimeout(function(){ if ($('#search-bar').val()) { - $("#Index ul a:not(:contains('" + $('#search-bar').val() + "'))" ).parent().hide(); - $("#Index ul a:contains('" + $('#search-bar').val() + "')" ).parent().show(); + var toShow = $('#Index ul a').filter(function(){ + return $(this).text().toLowerCase().indexOf($('#search-bar').val().toLowerCase()) > -1; + }); + toShow.parent().show(); + $("#Index ul a").not(toShow).parent().hide(); } else { $("#Index ul li" ).show(); |