mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add a "searching..." indicator to show progress
This commit is contained in:
parent
11a6052871
commit
f1876ae28b
@ -74,6 +74,9 @@ function updateSearch() {
|
||||
});
|
||||
|
||||
searchQueries = [];
|
||||
|
||||
// Show the "searching" text
|
||||
$('#offcanvas-search').find('#search-pending').show();
|
||||
|
||||
// Search for matching parts
|
||||
searchQueries.push(inventreeGet(
|
||||
@ -123,6 +126,11 @@ function updateSearch() {
|
||||
}
|
||||
}
|
||||
));
|
||||
|
||||
// Wait until all the pending queries are completed
|
||||
$.when.apply($, searchQueries).done(function() {
|
||||
$('#offcanvas-search').find('#search-pending').hide();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -132,6 +140,9 @@ function clearSearchResults() {
|
||||
|
||||
// Ensure the 'no results found' element is visible
|
||||
panel.find('#search-no-results').show();
|
||||
|
||||
// Ensure that the 'searching' element is hidden
|
||||
panel.find('#search-pending').hide();
|
||||
|
||||
// Delete any existing search results
|
||||
panel.find('#search-results').empty();
|
||||
|
@ -19,6 +19,12 @@
|
||||
</div>
|
||||
<div class="offcanvas-body">
|
||||
<div id="search-center">
|
||||
<p id='search-pending' class='text-muted' display='none'>
|
||||
<em>{% trans "Searching" %}...</em>
|
||||
<span class='float-right'>
|
||||
<span class='fas fa-spinner fa-spin'></span>
|
||||
</span>
|
||||
</p>
|
||||
<p id='search-no-results' class='text-muted'>
|
||||
<em>{% trans "No search results" %}</em>
|
||||
</p>
|
||||
|
Loading…
Reference in New Issue
Block a user