Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jeffrey Phillips Freeman
agusmakmun-github-io
Commits
3f5a72c2
Commit
3f5a72c2
authored
Apr 22, 2016
by
agusmakmun
Browse files
Fixing Match all strings input to lowercase
parent
eda79095
Changes
1
Hide whitespace changes
Inline
Side-by-side
static/js/super-search.js
View file @
3f5a72c2
...
...
@@ -102,7 +102,7 @@
searchInputEl
.
addEventListener
(
'
input
'
,
function
onInputChange
()
{
var
currentResultHash
,
d
;
currentInputValue
=
searchInputEl
.
value
;
currentInputValue
=
(
searchInputEl
.
value
+
''
).
toLowerCase
()
;
if
(
!
currentInputValue
||
currentInputValue
.
length
<
3
)
{
lastSearchResultHash
=
''
;
searchResultsEl
.
classList
.
add
(
'
is-hidden
'
);
...
...
@@ -111,7 +111,7 @@
searchResultsEl
.
style
.
offsetWidth
;
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
;
}
});
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment