Add is-loading to search input

This commit is contained in:
Peter Stuifzand 2020-07-12 18:01:19 +02:00
parent 5d924744de
commit e5e388d61e

View File

@ -6,6 +6,7 @@ function search(element) {
resolve({
element: element,
search(query) {
element.classList.add('is-loading')
return fetch('/search/?' + qs.encode({q:query}))
.then(res => res.json())
.then(data => {
@ -16,6 +17,7 @@ function search(element) {
title: value.id.replace(/_/g, ' '),
})
})
element.classList.remove('is-loading')
return actualResult
})
}