From fcf8b9b1953a5e261beb27c17be50b42fc7079ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sat, 6 Apr 2019 22:19:23 +0200 Subject: [PATCH] search: add a CSS class while searching is in progress (#18921) --- combo/apps/search/templates/combo/search-cell.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/combo/apps/search/templates/combo/search-cell.html b/combo/apps/search/templates/combo/search-cell.html index 80374605..f10cefd0 100644 --- a/combo/apps/search/templates/combo/search-cell.html +++ b/combo/apps/search/templates/combo/search-cell.html @@ -22,6 +22,8 @@ $(function() { {% endfor %} function update() { + $form.addClass('searching'); + var count = {{ cell.search_services|length }}; {% for search_service in cell.search_services %} if (xhr_{{ forloop.counter }}) xhr_{{ forloop.counter }}.abort(); xhr_{{ forloop.counter }} = $.get(url_{{ forloop.counter }}, @@ -29,6 +31,10 @@ $(function() { function (response) { xhr_{{ forloop.counter }} = null; $results_{{ forloop.counter }}.html(response); + count--; + if (count == 0) { + $form.removeClass('searching'); + } } ); {% endfor %}