mirror of
https://github.com/ipfs/awesome-ipfs.git
synced 2024-12-26 15:59:33 -05:00
Merge pull request #162 from ipfs/feat/better-search
feat: improved search
This commit is contained in:
commit
94e5cf2f44
@ -43,13 +43,17 @@ if (search) {
|
||||
const input = search.querySelector('input')
|
||||
|
||||
input.addEventListener('keyup', () => {
|
||||
const search = input.value
|
||||
let search = input.value
|
||||
|
||||
if (search === '') {
|
||||
cards.forEach((c) => c.classList.remove('dn'))
|
||||
return
|
||||
}
|
||||
|
||||
if (!search.endsWith('*')) {
|
||||
search = `${search} ${search}*`
|
||||
}
|
||||
|
||||
try {
|
||||
update(idx.search(search).map(s => s.ref))
|
||||
} catch (e) {
|
||||
|
Loading…
Reference in New Issue
Block a user