aboutsummaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorKamil Doległo <kamilok1965@interia.pl>2020-03-11 19:42:37 +0100
committerKamil Doległo <kamilok1965@users.noreply.github.com>2020-03-11 21:53:02 +0100
commitf60a499f6242411e191c60dd5ca1578155594103 (patch)
treec19ff2cd130fcf009215291d01294e81b1b13b5e /core/src
parent03fef66d5516f14e8c3a63784ccdc1a9fa492934 (diff)
downloaddokka-f60a499f6242411e191c60dd5ca1578155594103.tar.gz
dokka-f60a499f6242411e191c60dd5ca1578155594103.tar.bz2
dokka-f60a499f6242411e191c60dd5ca1578155594103.zip
Make search case-insensitive
It improves user experience
Diffstat (limited to 'core/src')
-rw-r--r--core/src/main/resources/dokka/scripts/search.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/core/src/main/resources/dokka/scripts/search.js b/core/src/main/resources/dokka/scripts/search.js
index 63112ac5..04d88ab5 100644
--- a/core/src/main/resources/dokka/scripts/search.js
+++ b/core/src/main/resources/dokka/scripts/search.js
@@ -1,5 +1,7 @@
-var query = new URLSearchParams(window.location.search).get("query");
- document.getElementById("searchTitle").innerHTML += '"' + query + '":';
- document.getElementById("searchTable").innerHTML = pages.filter(el => el.name.startsWith(query)).reduce((acc, element) => { return acc +
- '<tr><td><a href="' + element.location + '">' + element.name + '</a></td></tr>'
+let query = new URLSearchParams(window.location.search).get("query");
+document.getElementById("searchTitle").innerHTML += '"' + query + '":';
+document.getElementById("searchTable").innerHTML = pages
+ .filter(el => el.name.toLowerCase().startsWith(query.toLowerCase()))
+ .reduce((acc, element) => {
+ return acc + '<tr><td><a href="' + element.location + '">' + element.name + '</a></td></tr>'
}, ""); \ No newline at end of file