mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-06 07:38:25 -04:00
Added a "No results found"
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
let query = normalize($searchBox.val());
|
let query = normalize($searchBox.val());
|
||||||
let results = 0;
|
let results = 0;
|
||||||
|
let $noResultsMessage = $('.js-live-search-no-results');
|
||||||
|
|
||||||
$targets.each(function() {
|
$targets.each(function() {
|
||||||
|
|
||||||
@@ -39,6 +40,12 @@
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (query !== '' && results === 0) {
|
||||||
|
$noResultsMessage.show();
|
||||||
|
} else {
|
||||||
|
$noResultsMessage.hide();
|
||||||
|
}
|
||||||
|
|
||||||
if (state === 'loaded') {
|
if (state === 'loaded') {
|
||||||
if (query !== '') {
|
if (query !== '') {
|
||||||
$searchBox.attr('aria-label', $searchLabel.text().trim() + ', ' + resultsSummary(results));
|
$searchBox.attr('aria-label', $searchLabel.text().trim() + ', ' + resultsSummary(results));
|
||||||
|
|||||||
@@ -36,6 +36,9 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="user-list">
|
<div class="user-list">
|
||||||
|
<div class="js-live-search-no-results margin-top-3" style="display: none;">
|
||||||
|
<p class="usa-body margin-0">No results found</p>
|
||||||
|
</div>
|
||||||
{% for user in users %}
|
{% for user in users %}
|
||||||
{% if user.status != 'cancelled' %}
|
{% if user.status != 'cancelled' %}
|
||||||
<div class="user-list-item width-full">
|
<div class="user-list-item width-full">
|
||||||
|
|||||||
Reference in New Issue
Block a user