Add is-loading to search input
This commit is contained in:
parent
5d924744de
commit
e5e388d61e
|
@ -6,6 +6,7 @@ function search(element) {
|
||||||
resolve({
|
resolve({
|
||||||
element: element,
|
element: element,
|
||||||
search(query) {
|
search(query) {
|
||||||
|
element.classList.add('is-loading')
|
||||||
return fetch('/search/?' + qs.encode({q:query}))
|
return fetch('/search/?' + qs.encode({q:query}))
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
|
@ -16,6 +17,7 @@ function search(element) {
|
||||||
title: value.id.replace(/_/g, ' '),
|
title: value.id.replace(/_/g, ' '),
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
element.classList.remove('is-loading')
|
||||||
return actualResult
|
return actualResult
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user