mirror of
https://github.com/alvierahman90/gronk.git
synced 2025-01-12 02:04:19 +00:00
Compare commits
2 Commits
6638c72230
...
fa8840d25e
Author | SHA1 | Date | |
---|---|---|---|
|
fa8840d25e | ||
|
07ece47980 |
@ -6,7 +6,7 @@ const TITLE = "title"
|
|||||||
const SEARCH_TIMEOUT_MS = 100
|
const SEARCH_TIMEOUT_MS = 100
|
||||||
var SEARCH_TIMEOUT_ID = -1
|
var SEARCH_TIMEOUT_ID = -1
|
||||||
|
|
||||||
const fuse = new Fuse(data, {
|
const fuse = new Fuse(search_data, {
|
||||||
keys: [ 'title' ],
|
keys: [ 'title' ],
|
||||||
ignoreLocation: true,
|
ignoreLocation: true,
|
||||||
threshhold: 0.4,
|
threshhold: 0.4,
|
||||||
@ -30,7 +30,7 @@ function updateResults() {
|
|||||||
console.log("updating results")
|
console.log("updating results")
|
||||||
resultsDiv.innerHTML = ''
|
resultsDiv.innerHTML = ''
|
||||||
if (searchBar.value) results = fuse.search(searchBar.value, { limit: RESULTS_MAX }).map(r => r.item)
|
if (searchBar.value) results = fuse.search(searchBar.value, { limit: RESULTS_MAX }).map(r => r.item)
|
||||||
else results = data
|
else results = search_data
|
||||||
|
|
||||||
results.forEach(r => {
|
results.forEach(r => {
|
||||||
wrapper = document.createElement('li')
|
wrapper = document.createElement('li')
|
||||||
|
Loading…
Reference in New Issue
Block a user