From 507d26615775cc233413cbb140dd3e7ccf971567 Mon Sep 17 00:00:00 2001 From: gabrielchiquini Date: Sat, 30 Sep 2017 23:48:29 -0300 Subject: tdf#112370 Add case-insensitive support to index search Change-Id: I460f853f4abd6bf8124f2b6d01d5b771fcc6569c Reviewed-on: https://gerrit.libreoffice.org/42984 Reviewed-by: Olivier Hallot Tested-by: Olivier Hallot --- help3xsl/help.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'help3xsl') 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(); -- cgit