summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>2018-11-10 17:50:45 +0200
committerOlivier Hallot <olivier.hallot@libreoffice.org>2018-11-11 20:40:50 +0100
commit12cf5b53b185177924dd7ce572bc7451c9edc76b (patch)
tree9713754961e8ed4bba63c038511836470794ce20
parente8b0895cb28ecfdbc054aa26e138f17db6776a03 (diff)
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@libreoffice.org>
-rw-r--r--help3xsl/help.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/help3xsl/help.js b/help3xsl/help.js
index b67df2452a..7837f7f670 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]);