mirror of
https://github.com/aljazceru/cryptoanarchywiki.github.io.git
synced 2025-12-17 13:14:21 +01:00
Fixing Match all strings input to lowercase
This commit is contained in:
@@ -102,7 +102,7 @@
|
|||||||
searchInputEl.addEventListener('input', function onInputChange() {
|
searchInputEl.addEventListener('input', function onInputChange() {
|
||||||
var currentResultHash, d;
|
var currentResultHash, d;
|
||||||
|
|
||||||
currentInputValue = searchInputEl.value;
|
currentInputValue = (searchInputEl.value + '').toLowerCase();
|
||||||
if (!currentInputValue || currentInputValue.length < 3) {
|
if (!currentInputValue || currentInputValue.length < 3) {
|
||||||
lastSearchResultHash = '';
|
lastSearchResultHash = '';
|
||||||
searchResultsEl.classList.add('is-hidden');
|
searchResultsEl.classList.add('is-hidden');
|
||||||
@@ -111,7 +111,7 @@
|
|||||||
searchResultsEl.style.offsetWidth;
|
searchResultsEl.style.offsetWidth;
|
||||||
|
|
||||||
var matchingPosts = posts.filter(function (post) {
|
var matchingPosts = posts.filter(function (post) {
|
||||||
if (post.title.indexOf(currentInputValue) !== -1 || post.description.indexOf(currentInputValue) !== -1) {
|
if ((post.title + '').toLowerCase().indexOf(currentInputValue) !== -1 || (post.description + '').toLowerCase().indexOf(currentInputValue) !== -1) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user