[Libreoffice-commits] help.git: help3xsl/help.js

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sun Nov 11 19:41:09 UTC 2018


 help3xsl/help.js |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

New commits:
commit 12cf5b53b185177924dd7ce572bc7451c9edc76b
Author:     Ilmari Lauhakangas <ilmari.lauhakangas at libreoffice.org>
AuthorDate: Sat Nov 10 17:50:45 2018 +0200
Commit:     Olivier Hallot <olivier.hallot at libreoffice.org>
CommitDate: Sun Nov 11 20:40:50 2018 +0100

    Fixed some silliness, added highlighting for index filter
    
    Change-Id: I946ffdb52ed8f324ab58f45a90f5decdd58932dc
    Reviewed-on: https://gerrit.libreoffice.org/63240
    Tested-by: Jenkins
    Reviewed-by: Olivier Hallot <olivier.hallot at libreoffice.org>

diff --git a/help3xsl/help.js b/help3xsl/help.js
index b67df2452..7837f7f67 100644
--- a/help3xsl/help.js
+++ b/help3xsl/help.js
@@ -37,16 +37,14 @@ function addIds() {
         indexkids[i].removeAttribute("id");
     }
     modules.forEach(function(module) {
-        var hoduleHeader = document.getElementsByClassName(module)[0];
+        var moduleHeader = document.getElementsByClassName(module)[0];
         if (typeof moduleHeader !== 'undefined') {
-            hoduleHeader.setAttribute("id", module);
+            moduleHeader.setAttribute("id", module);
         }
     });
 }
 // render the unfiltered index list on page load
 fullList();
-Paginator(document.getElementsByClassName("index")[0]);
-addIds();
 // filter the index list based on search field input
 var search = document.getElementById('search-bar');
 var filter = function() {
@@ -58,7 +56,7 @@ var filter = function() {
     results = fuzzysort.go(target, bookmarks, {threshold: -15000, key:'text'});
     var filtered = '';
     results.forEach(function(result) {
-        filtered += '<a href="' + result.obj['url'] + '" class="' + result.obj['app'] + '">' + result.obj['text'] + '</a>';
+        filtered += '<a href="' + result.obj['url'] + '" class="' + result.obj['app'] + '">' + fuzzysort.highlight(result) + '</a>';
     });
     document.getElementsByClassName("index")[0].innerHTML = filtered;
     Paginator(document.getElementsByClassName("index")[0]);


More information about the Libreoffice-commits mailing list