From e5e388d61e9e6fec64c5ccf91970de689ef88fe0 Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Sun, 12 Jul 2020 18:01:19 +0200 Subject: [PATCH] Add is-loading to search input --- editor/src/search.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/editor/src/search.js b/editor/src/search.js index 428dffe..a4aeca1 100644 --- a/editor/src/search.js +++ b/editor/src/search.js @@ -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 }) }