search: add a CSS class while searching is in progress (#18921)
This commit is contained in:
parent
aea9d7db5d
commit
fcf8b9b195
|
@ -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 %}
|
||||
|
|
Loading…
Reference in New Issue