mirror of
https://github.com/seigler/awesome-dash-platform
synced 2025-07-27 06:36:08 +00:00
feat: improved search
License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com>
This commit is contained in:
parent
330e0c7a35
commit
257c578feb
1 changed files with 5 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue