Merge pull request #162 from ipfs/feat/better-search

feat: improved search
This commit is contained in:
ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ 2018-07-27 13:08:27 +02:00 committed by GitHub
commit 94e5cf2f44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) {